anmonteiro / lumo

Fast, cross-platform, standalone ClojureScript environment
Eclipse Public License 1.0
1.88k stars 84 forks source link

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

Open tiye opened 6 years ago

tiye commented 6 years ago

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...

mfikes commented 6 years ago

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)
tiye commented 6 years ago

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

tiye commented 6 years ago

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
anmonteiro commented 6 years ago

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

anmonteiro commented 6 years ago

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