(interactions done using nc
connected to a socket repl laucnhed from lumo (but now lumo’s own socket repl))
cljs.user=>(require '[net.cgrand.cljs.js.repl.main :as m])
nil
cljs.user=>(m/repl :eval r/eval :prompt #(print"nested=>") :read (fn [rp re cb] (m/repl-read rp re (fn [form e] (cb ({'exit re} form form) e)))))
nested=>nested=>true
The double prompt occurs with clojure.main/repl
too. The true
is the result of the above evaluation (because it’s async)
12 ; input
12
nested=>(+ 2 3)
5
nested=>exit
cljs.user=>
That's awesome
works only with lumo for now because writing the socket server was easier (for Planck I would have to look at its impl)
I would really appreciate a cljs or cljc port of unrepl.print
🦜