@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
like #user.r[1]
?
yes
like #foo.bar.Record[1 2]
specifically
through clojure -m foo.bar
this fails - but if I use -i
and -e
to run my entrypoint it works
can you share a repro - seems to work for me
yes, give me a bit I'll try to put something together
when it fails, what do you get?
could not load namespace - oh but one second - the error does come from tools reader
@alexmiller https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L818 here
is this right?
what happens is that if I run via -main
this line fails, but if I run via REPL it succeeds
you might also look at http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defrecord option :load-ns
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
well the observed issue isn't about the namespace being loaded
the namespace is loaded - but the class lookup part fails
repl inserts a DCL layer, but I think clojure.main -m does not
so could be classloader
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
well can confirm I don't see this behavior with Clojure by itself