Closed mfikes closed 9 years ago
@swannodette This might be interesting to you: You said you were going out of your way in ClojureScript master not to break things, even if they get ugly under the hood. At the core of this NPE is the fact that this line of code looks like it ensures that :print
, :flush
, etc. are initialized in *repl-opts*
. But, Piggieback, in the same way it doesn't call the code that does :merge-opts
, also doesn't call the code that initializes *repl-opts*
. ClojureScript master could get even uglier defending against this possibility (I found it is fixable for this case with something like the diff below) or if Piggieback is the only things out there that results in this, then perhaps Piggieback could be patched to also set *repl-opts*
(not sure if that feels right either).
-(def ^:dynamic *repl-opts* nil)
+(def ^:dynamic *repl-opts* {:print println :print-no-newline print :flush flush})
@mfikes not breaking Piggieback is out of scope, we're not going to account for it as it is a big series of hacks around fundamental problems. This is not the case for 3rd party REPLs that depend on the CLJS REPL infrastructure directly for behavior.
Since we know this is not an Ambly issue, closing.
If I use https://github.com/clojure/clojurescript/commit/9edde9173bb927e68fb18741107293627a2428f9 and start up REPL in Cursive (using Piggieback), and then type
foo
, I get:But with ClojureScript master, I get: