tools.reader

CLJS: syntax-quote doesn't auto-qualify symbols

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

If x resolves to cljs.user/x then read-string on "`x" should result in the cljs.user namespace being incorporated in the result.

For example, testing using the Node REPL that ships with ClojureScript:

cljs.user=> (require '[cljs.tools.reader :as r])
nil
cljs.user=> (binding [r/resolve-symbol (fn [_] 'cljs.user/x)]
  (r/read-string "`x"))
(quote x)

The result should instead be

(quote cljs.user/x)

Activity

Hide
Mike Fikes added a comment -

Analysis: resolve-symbol should be called in the syntax-quote* cond branch dealing with symbol?. (just as is done in the CLJ implementation).

Show
Mike Fikes added a comment - Analysis: resolve-symbol should be called in the syntax-quote* cond branch dealing with symbol?. (just as is done in the CLJ implementation).
Hide
Mike Fikes added a comment -

The attached unit test causes unit tests to pass.

Additionally, it works properly downstream with the Planck bootstrapped ClojureScript REPL, producing the expected output for the syntax quote examples in Colin Jones's post: https://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html

Show
Mike Fikes added a comment - The attached unit test causes unit tests to pass. Additionally, it works properly downstream with the Planck bootstrapped ClojureScript REPL, producing the expected output for the syntax quote examples in Colin Jones's post: https://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html
Hide
Nicola Mometto added a comment -

Thanks, pushed a fix

Show
Nicola Mometto added a comment - Thanks, pushed a fix

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: