cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2020-07-01T14:16:33.374300Z

@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

alexmiller 2020-07-01T14:22:39.375600Z

like #user.r[1] ?

dnolen 2020-07-01T14:23:14.375900Z

yes

dnolen 2020-07-01T14:23:31.376300Z

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

dnolen 2020-07-01T14:23:48.376700Z

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

alexmiller 2020-07-01T14:29:43.377200Z

can you share a repro - seems to work for me

dnolen 2020-07-01T14:30:08.377600Z

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

alexmiller 2020-07-01T14:30:41.377800Z

when it fails, what do you get?

dnolen 2020-07-01T14:40:43.378200Z

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

dnolen 2020-07-01T14:43:22.378800Z

is this right?

dnolen 2020-07-01T14:43:36.379200Z

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

alexmiller 2020-07-01T14:54:51.379500Z

you might also look at http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defrecord option :load-ns

alexmiller 2020-07-01T14:55:53.380500Z

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

dnolen 2020-07-01T15:12:08.381Z

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

dnolen 2020-07-01T15:12:19.381400Z

the namespace is loaded - but the class lookup part fails

alexmiller 2020-07-01T15:16:19.381900Z

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

alexmiller 2020-07-01T15:16:24.382100Z

so could be classloader

dnolen 2020-07-01T15:24:08.382800Z

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

dnolen 2020-07-01T16:31:03.383200Z

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