Fork me on GitHub
#cljs-dev
<
2020-07-01
>
dnolen14:07:33

@alexmiller I should probably make a minimal case to see if this occurs in Clojure - but what I observed in the tests is that record data literals only work when launched through REPL not via some user -main

dnolen14:07:31

like #foo.bar.Record[1 2] specifically

dnolen14:07:48

through clojure -m foo.bar this fails - but if I use -i and -e to run my entrypoint it works

Alex Miller (Clojure team)14:07:43

can you share a repro - seems to work for me

dnolen14:07:08

yes, give me a bit I'll try to put something together

Alex Miller (Clojure team)14:07:41

when it fails, what do you get?

dnolen14:07:43

could not load namespace - oh but one second - the error does come from tools reader

dnolen14:07:22

is this right?

dnolen14:07:36

what happens is that if I run via -main this line fails, but if I run via REPL it succeeds

Alex Miller (Clojure team)14:07:53

which is specifically targeted at auto-loading the namespace for a record on import. really designed for java interop use but seems in the ballpark here

dnolen15:07:08

well the observed issue isn't about the namespace being loaded

dnolen15:07:19

the namespace is loaded - but the class lookup part fails

Alex Miller (Clojure team)15:07:19

repl inserts a DCL layer, but I think clojure.main -m does not

Alex Miller (Clojure team)15:07:24

so could be classloader

dnolen15:07:08

in the end not a big deal since it's possible to work around - but it was a head scratcher - but thought maybe you had more insight

dnolen16:07:03

well can confirm I don't see this behavior with Clojure by itself