I'm a bit out of the loop on this one, can someone fill me in on what the status is of unrepl for ClojureScript? (bootstrapped or otherwise)
print.clj needs porting afaik
ok so I'm having a go at this, using reader conditionals to smooth over the differences, but this is problematic because a regular clojure repl doesn't allow reader conditionals
[:unrepl.upgrade/failed]
RuntimeException Conditional read not allowed clojure.lang.Util.runtimeException (Util.java:221)
user=>
Anyone know if there's a way to "compile" cljc to clj or cljs? i.e. to only expand the reader conditionals, but leave everything else as is?
@plexus if I understand right..the reader should read only the relevant parts so a cljs repl on nrepl+piggieback (you need a cljs repl I guess) should read the cljs part only. No need to get rid of the unwanted parts. It makes so much more sense to have it on bootstrap though (Lumo)
yeah, the thing is that the reader refuses to do that
it does it when reading from a CLJC file, but on the REPL it just throws an error when using reader conditionals
Uhm odd, what is the error?
Clojure: RuntimeException Conditional read not allowed
lumo: #error {:message read-cond body must be a list, :data {:type :runtime-exception}, :cause #error {:message read-cond body must be a list, :data {:type :runtime-exception}}}
I'm trying with rewrite-clj to scrub out the conditionals when building the blob
Sounds like a syntax error somewhere, but I have never seen that..It can be anything
well the clojure case very clearly says that it simply not allowed
https://danielcompton.net/2015/05/21/conditional-read-not-allowed-clojure-reader-conditionals
so while some environments might accept reader conditionals fine it seems we can't assume that all will
Uhm, but you are in a nrepl for the first and therefore if you have conditionals in cljc file only it should work...This is very odd indeed
@plexus not a problem. At the moment only Clojure REPL can be upgraded and I have control on the reader during the upgrade.
so what about ClojureScript?
@cgrand could you say in a few words what you think needs to happen for unrepl to work on Lumo? I started porting print.clj to cljc, I thought that would be a good start, but I'm not sure how you see things or what else is involved
ok, I'm starting to see what you're saying. The blob instantiates a reader, so you have some leverage there as to how that behaves
@plexus if it helps with your reader conditional issue, Alex's lib might be of interest: https://github.com/aengelberg/cljsee
@plexus well Clojure complains as soon as the ?
is read it doesn't attempt to read further. So you could still have two problems (a syntax reported by cljs and a Clojure setup).
@plexus just read with right options (see arity 2)