(rontolisp) docs

nREPL

rontolisp --nrepl serves the Clojure REPL over nREPL, the protocol editors (CIDER, Calva, Conjure) and clj -M -m nrepl.cmdline --connect speak. It listens on localhost, on a free port unless --nrepl=PORT names one, prints the line nREPL's own server prints (editors read the port from it), and writes the port to .nrepl-port in the working directory, deleted when the server ends. deps.edn aliases apply as in the REPL (rontolisp -A:dev --nrepl).

$ rontolisp --nrepl
nREPL server started on port 41831 on host localhost - nrepl://localhost:41831
$ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.3.1"}}}' -M -m nrepl.cmdline --connect --port 41831
user=> (defn g [] 1)
#'user/g
user=> (defn f [] (g))
#'user/f
user=> (defn g [] 2)
#'user/g
user=> (f)
2

The server answers the operations of nREPL 1.3's default handler an editor needs, in the shapes nREPL answers them:

OperationAnswer
clone, close, ls-sessionsthe sessions
evala value per form with the namespace then current, *out* and *err* as out and err replies; a form that fails reports on err and the forms after it run
load-filethe file's contents loaded: its namespace is the load's own, its last value answers
interruptthe running evaluation stops at its next function call or loop step; the session goes on
completionsthe vars, namespaces and special forms a prefix completes, one part per - or . segment
describethe operations and the versions

The sessions share one runtime, as nREPL's do: what one session defines, another calls. Each keeps its own *ns*, *1, *2, *3, *e and the flags set! changes (*print-length*, *warn-on-reflection*).

Not answered: stdin (an evaluation reading *in* reads its end), lookup, the middleware operations and cider-nrepl's, so an editor works through its fallbacks. A report's place names no eval class (at (REPL:1) where nREPL writes at user/eval1234 (REPL:1)).