I'm working on some pREPL based tooling and noticed that if a JVM Clojure pREPL throws an error it is sent to stderr as well as a `:ret` under the `:val` keyword as a string.
When ClojureScript throws an error (in this case within nodejs) there is no stderr output and the `:val` contains actual EDN data, not a string. This inconsistency breaks the assumption that `:val` will always be a string of EDN data.
I've never raised an issue with Clojure before or submitted a patch, I am happy to do so if this is deemed a valid issue and worth fixing.
Arch Linux x86_64
CLJS-2994.patch passes CI
Oliver, I believe this patch allows more than the Clojure pREPL, yes? i.e. the valf customization bit?
Not as far as I know, unless I'm misunderstanding your question. Clojure also allows you to provide valf to io-prepl which defaults to pr-str.
I've tried to align this as closely as I can, the main difference here is that ClojureScript eval already returns results as strings, so identity is okay in most cases. When our prepl returns exceptions however we now pr-str those.
Thanks, I double checked and can confirm. Looks good to me.