lumo icon indicating copy to clipboard operation
lumo copied to clipboard

a.b$macros is different than aa.b$macros in REPL

Open tiye opened this issue 8 years ago • 5 comments

I found my experiment failed:

a.b$macros=> (ns a.core$macros)
nil
a.core$macros=> (defmacro hell [x] `(+ x 2))
#'a.core$macros/hell
a.core$macros=> (macroexpand '(a.core/hell 1))
(a.core/hell 1)

Then tried with a.core, aaaa.b, aa.b, and most of them works

a.core$macros=> (ns foo.core$macros)
nil
foo.core$macros=> (defmacro hell [x] `(+ x 2))
#'foo.core$macros/hell
foo.core$macros=> (macroexpand '(foo.core/hell 1))
(js* "(~{} + ~{})" foo.core/x 2)

Can't figure out why...

tiye avatar Oct 27 '17 08:10 tiye

Not reproducible in Planck:

$ planck
Planck 2.8.1
ClojureScript 1.9.947
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
    Exit: Control+D or :cljs/quit or exit or quit
 Results: Stored in vars *1, *2, *3, an exception in *e

cljs.user=> (ns a.core$macros)
nil
a.core$macros=> (defmacro hell [x] `(+ x 2))
#'a.core$macros/hell
a.core$macros=> (macroexpand '(a.core/hell 1))
(js* "(~{} + ~{})" a.core/x 2)

mfikes avatar Oct 27 '17 13:10 mfikes

@mfikes I think we should trya.b, which is so short than anything.

tiye avatar Oct 27 '17 14:10 tiye

Nooooo.....

cljs.user=> (ns a.core$macros)
nil
a.core$macros=> (defmacro hell [x] `(+ x 2))
undefined is not an object (evaluating 'a.core$macros')

a.core$macros=>
=>> planck --version
2.8.1

tiye avatar Oct 27 '17 14:10 tiye

This is still an upstream issue. Apparently https://dev.clojure.org/jira/browse/CLJS-2024 wasn't enough to fix it.

anmonteiro avatar Nov 25 '17 21:11 anmonteiro

Submitted a fix in https://dev.clojure.org/jira/browse/CLJS-2419, will close this when a released version of ClojureScript includes the patch.

anmonteiro avatar Nov 25 '17 21:11 anmonteiro