not sure why this happens, seems to work in jvm cljs
(ns foo.bar
(:require-macros foo.bar))
(defrecord X [])
(defmacro cake []
`(foo.bar/X.))
you forgot to self-require macros 🙂
@anmonteiro but I did refer-macros
my first approach was actually self-require, but that does not work either
:refer-macros
only works if the namespace has a self-require
it worked for me
notice how I also namespace-qualified foo.bar/X
well that's the thing, why do I have to do that
and I thought :refer-macros
works w/o self-require? certainly does in jvm cljs
also works in lumo, so that's not the issue
@moxaj actually it works in Planck without the qualifying
so feel free to open a ticket
alrighty
pr for the closure libs support coming soon, gonna need reviews for sure
@moxaj that’s awesome!
@moxaj @anmonteiro That code doesn’t work when Planck is built against ClojureScript master, so something may have broken upstream. You can work around the issue by instead writing
(defmacro cake []
`(->X))
which is better anyways. (See https://stuartsierra.com/2015/05/17/clojure-record-constructors)It is still probably worth filing a Jira against ClojureScript.
@mfikes that's really helpful, thanks!
I bet it was a result of the desire to properly handle symbols with dots in it.
Let me dig up that change.
considering the fact that you have to namespace qualify differently in clj and cljs
the records at least
My hunch is https://dev.clojure.org/jira/browse/CLJS-2109 broke it. Will find out real quick.
Actually it can’t be that ^ as that is newer than the version of Lumo that it fails in.
I’ll do a git bisect
thanks for taking the time to investigate it! I'd do it if I was more familiar with building master / bisecting / stuff
@mfikes so it’s somewhere between 562 and 671?
looks related to defrecord
only
adding a macro that calls a function works
might actually be CLJS-2109
Yes, it is. Logging a JIRA
@moxaj Found the bad commit. If you are curious about how to bisect: https://gist.github.com/mfikes/410ed3227572dd0bec2c64fb5957d941
@mfikes wow, thanks!
I have somewhat of an irrational fear of new git commands, as they might open vim and then i'm doomed
Hah. @moxaj I don’t even use command line git
. But those instructions would be done in a separate checkout, and usually take 8 cycles or less to pinpoint the bad commit. 🙂
@anmonteiro There might be more to the above, as it fails for me in Lumo 1.5.0, which is built against ClojureScript 1.9.542.
@mfikes amazing guide for bisecting
FWIW if you use Emacs + Magit it’s even easier
Another consistent explanation would be that it was broken in 1.9.542, got fixed in 1.9.562, and then regressed again in 1.9.655 (shrug)
well
what about a Planck that has 1.9.542?
thanks for the minimal repro too, will make for a good test case in test-self-host