Clojure has *1
, *2
, & *3
. Common Lisp & Racket (w/ xrepl) have
similar. IIRC, IPython & irb keep a list of all outputs in the current
session. With readline it is certainly possible to retrieve the previous
expression & wrap it with code to save the result to a variable, but
something like *1
is much simpler when experimenting in the REPL.
My apologies if Fennel's REPL already has something like this. I couldn't find it. :)
Seems reasonable. We could inject these with the same mechanism we use to inject repl locals.
Happy to take a patch if anyone wants to give this a shot.