Fork me on GitHub
#unrepl
<
2019-05-06
>
mkvlr14:05:16

hey 👋 we’re using unrepl at Nextjournal for our Clojure eval. Any recommendation how to make it play nice with notebooks where you want to show an error if an expression is incomplete?

mkvlr14:05:53

we recently introduced reading on the clojure side to check it’s complete but now realised this breaks on namespaced keywords etc

cgrand14:05:43

It’s crude but: take your input (notebook cell) and send `(eval (read-string ~cell)) to unrepl thus the reading will occur on the other side

cgrand14:05:37

(ok it’s too crude: you have to take into account that the cell may contain multiple forms but you get the idea)

mkvlr14:05:09

that’s a simpler workaround than what we could have thought of

mkvlr14:05:20

is that what you do in IClojure as well?

mkvlr14:05:47

thanks a lot! 🙏

mkvlr14:05:09

do you also get line number info out in IClojure?

cgrand14:05:38

on exceptions? yes but the top frames of the exceptions are from the above wrapping

mkvlr15:05:16

@cgrand thanks again, your solution works like a charm and is now deployed on http://nextjournal.com