Document the availability/usage of *e, *1, *2, ... in nREPL
Description
Environment
Activity
Alex Miller June 26, 2019 at 3:52 AM
All nrepl tickets closed, now managed at https://github.com/nrepl/nrepl
import August 24, 2013 at 11:52 AM
I have created an issue under Clojure itself, #CLJ-1247, so this can likely be closed.
import August 24, 2013 at 11:38 AM
I have published a blog post about this, Clojure REPL stores the latest results in *1, *2, *3, exception in *e, to make it more googlable (is that even a word? ).
The top hit for "Clojure REPL" seems to be http://clojure.org/repl_and_main, so it perhaps should be documented there or it should link to a more detailed documentation. Not sure how to make that happen I have also checked http://clojure-doc.org/ but there doesn't seem to be a suitable place to add this info either. Perhaps it should be mentioned in the docstring of clojure.main/repl and the Clojure page should link to it?
import August 24, 2013 at 10:50 AM
Thanks a lot, Chas, that was helpful. I have submitted a patch to Leiningen to include the info it its REPL' welcome message: https://github.com/technomancy/leiningen/pull/1310
Chas Emerick July 22, 2013 at 1:52 PM
REPL-bound vars are documented in a variety of places, though nowhere "official" AFAIK. We talked about it in Chapter 10 of Clojure Programming FWIW (I'm certain other books and online resources cover these vars as well, but the CP citation is the only one I have close at hand.)
FYI, the "currently-provided info" you mention is emitted by Leiningen/Reply, not nREPL.
I have only by chance discovered that nREPL binds the lat error/outputs to the vars *e, *1 etc. This should be documented clearly somewhere, possibly in https://github.com/clojure/tools.nrepl/blob/master/README.md
When I have forgotten the names of the vars while remembering that something like them exists, I tried to google them out but failed. So better documentation would help.
Thank you!