unrepl

discussing specification of an edn-based repl and its implementations.
plexus 2017-05-21T13:35:58.223259Z

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)

dominicm 2017-05-21T13:44:44.250060Z

print.clj needs porting afaik

plexus 2017-05-21T15:31:47.613301Z

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

plexus 2017-05-21T15:32:03.614254Z

[:unrepl.upgrade/failed]

RuntimeException Conditional read not allowed  clojure.lang.Util.runtimeException (Util.java:221)
user=> 

plexus 2017-05-21T15:32:37.616311Z

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?

richiardiandrea 2017-05-21T15:44:00.654685Z

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

plexus 2017-05-21T15:44:32.656359Z

yeah, the thing is that the reader refuses to do that

plexus 2017-05-21T15:44:50.657360Z

it does it when reading from a CLJC file, but on the REPL it just throws an error when using reader conditionals

richiardiandrea 2017-05-21T15:46:09.661857Z

Uhm odd, what is the error?

plexus 2017-05-21T15:47:18.665885Z

Clojure: RuntimeException Conditional read not allowed

plexus 2017-05-21T15:47:27.666358Z

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}}}

plexus 2017-05-21T15:47:56.667907Z

I'm trying with rewrite-clj to scrub out the conditionals when building the blob

richiardiandrea 2017-05-21T15:49:52.674564Z

Sounds like a syntax error somewhere, but I have never seen that..It can be anything

plexus 2017-05-21T15:50:09.675595Z

well the clojure case very clearly says that it simply not allowed

plexus 2017-05-21T15:50:59.678544Z

so while some environments might accept reader conditionals fine it seems we can't assume that all will

richiardiandrea 2017-05-21T15:53:27.686799Z

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

cgrand 2017-05-21T15:57:10.699589Z

@plexus not a problem. At the moment only Clojure REPL can be upgraded and I have control on the reader during the upgrade.

plexus 2017-05-21T15:57:44.701584Z

so what about ClojureScript?

plexus 2017-05-21T16:06:15.734574Z

@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

plexus 2017-05-21T16:40:14.850762Z

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

mfikes 2017-05-21T20:16:58.638194Z

@plexus if it helps with your reader conditional issue, Alex's lib might be of interest: https://github.com/aengelberg/cljsee

cgrand 2017-05-21T20:28:47.679898Z

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

cgrand 2017-05-21T20:30:14.685056Z

@plexus just read with right options (see arity 2)