Clojurians
#lumo
<
2017-07-18
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

moxaj19:07:28

not sure why this happens, seems to work in jvm cljs

anmonteiro19:07:20

@moxaj

(ns foo.bar
  (:require-macros foo.bar))

(defrecord X [])

(defmacro cake []
  `(foo.bar/X.))

anmonteiro19:07:28

you forgot to self-require macros :slightly_smiling_face:

moxaj19:07:22

@anmonteiro but I did refer-macros

moxaj19:07:35

my first approach was actually self-require, but that does not work either

anmonteiro19:07:41

:refer-macros only works if the namespace has a self-require

anmonteiro19:07:44

it worked for me

anmonteiro19:07:05

notice how I also namespace-qualified foo.bar/X

moxaj19:07:19

well that's the thing, why do I have to do that

moxaj19:07:04

and I thought :refer-macros works w/o self-require? certainly does in jvm cljs

moxaj19:07:17

also works in lumo, so that's not the issue

anmonteiro19:07:02

@moxaj actually it works in Planck without the qualifying

anmonteiro19:07:08

so feel free to open a ticket

moxaj19:07:50

pr for the closure libs support coming soon, gonna need reviews for sure

anmonteiro19:07:23

@moxaj that’s awesome!

mfikes19:07:43

@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)

mfikes19:07:10

It is still probably worth filing a Jira against ClojureScript.

moxaj19:07:33

@mfikes that's really helpful, thanks!

mfikes19:07:50

I bet it was a result of the desire to properly handle symbols with dots in it.

mfikes19:07:55

Let me dig up that change.

moxaj19:07:55

considering the fact that you have to namespace qualify differently in clj and cljs

moxaj19:07:08

the records at least

mfikes19:07:46

My hunch is https://dev.clojure.org/jira/browse/CLJS-2109 broke it. Will find out real quick.

mfikes19:07:27

Actually it can’t be that ^ as that is newer than the version of Lumo that it fails in.

mfikes19:07:58

I’ll do a git bisect

moxaj19:07:58

thanks for taking the time to investigate it! I'd do it if I was more familiar with building master / bisecting / stuff

anmonteiro20:07:21

@mfikes so it’s somewhere between 562 and 671?

anmonteiro20:07:27

looks related to defrecord only

anmonteiro20:07:41

adding a macro that calls a function works

anmonteiro20:07:32

might actually be CLJS-2109

mfikes20:07:50

Yes, it is. Logging a JIRA

mfikes20:07:32

@moxaj Found the bad commit. If you are curious about how to bisect: https://gist.github.com/mfikes/410ed3227572dd0bec2c64fb5957d941

moxaj20:07:10

@mfikes wow, thanks!

moxaj20:07:42

I have somewhat of an irrational fear of new git commands, as they might open vim and then i'm doomed

mfikes20:07:45

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

mfikes20:07:58

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

anmonteiro20:07:27

@mfikes amazing guide for bisecting

anmonteiro20:07:30

FWIW if you use Emacs + Magit it’s even easier

mfikes20:07:05

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)

anmonteiro20:07:36

what about a Planck that has 1.9.542?

anmonteiro20:07:01

thanks for the minimal repro too, will make for a good test case in test-self-host