tools.reader

syntax-quote resolves on dot forms

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

In Clojure or ClojureScript, if you evaluate a form involving syntax-quote of a dot form, the instance member / field, is not resolved. For example, in ClojureScript,

`(.x o)

yields

(.x cljs.user/o)

If you use (the ClojureScript implementation of) tools.reader on such a form, you can see that the .x symbol is resolved (and if using cljs.analyzer/resolve-sym, you will get a slash).

An additional assertion in cljs.tools.reader-test/read-syntax-quote that illustrates a problem that exists (with at least the ClojureScript implementation of tools.reader):

(is (= (binding [resolve-symbol (constantly (symbol "/x"))]
           (read-string "`.x"))
        ''.x))

(This shows that the .x gets resolved to /x.)

Activity

Hide
Nicola Mometto added a comment -

This is not a tools.reader issue, `resolve-symbol` is responsible to do that kind of expansion and in CLJS `resolve-symbol` is a dynamic var with no default implementation that the clojurescript compiler defines.

The fix should go there.

Show
Nicola Mometto added a comment - This is not a tools.reader issue, `resolve-symbol` is responsible to do that kind of expansion and in CLJS `resolve-symbol` is a dynamic var with no default implementation that the clojurescript compiler defines. The fix should go there.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: