Socket REPL support for Planck has now landed in master. You can homebrew a copy of master via
brew remove planck
brew install --HEAD planck
When you launch Planck, pass the -n
argument specifying a port or IP:port combination
planck -n 5555
For example, planck -n 5555
results in Planck starting up a REPL, as usual, and you can use it like you normally would.
$ planck -n 5555
Planck socket REPL listening.
cljs.user=> 4
4
cljs.user=> (+ 5 6)
11
But in this mode it will now listen for connections on port 5555
.
$ rlwrap telnet 0 5555
Trying 0.0.0.0...
Connected to localhost.
Escape character is '^]'.
cljs.user=> (map inc (range 5))
(1 2 3 4 5)
cljs.user=>
You can make as many additional network sessions as you'd like. You can
additionally use :repl/quit
to get out of any of these network sessions.
These sessions all share the same underlying environment (analysis data, JavaScriptCore state, etc).
A consequence is that namespaces and def
s created in one session can be
seen in all others.
Try out
rlwrap nc localhost 5555
to get command line editing, etc.