The up-arrow key can recall the expressions you send thanks to either readline or Leiningen. You might be able to hook the appropriate var in leiningen.repl in order to slip your own function into the options passed to the Clojure REPL it starts.
You need to be able to intercept the form being evaluated so you can store it off somewhere (either in a var via set! or otherwise). Interesting idea. Maintaining command history on the server side of the REPL (i.e. more than just having *!1, *!2, *!3 [or whatever]) might have some good use cases in general. - Chas On Nov 9, 2011, at 1:25 PM, nchurch wrote: > I mean I want to write a utility that has access to the previous > expression entered at the REPL no matter where this utility is > called. Since the up-arrow key has this access, it must be > possible.... > > On Nov 9, 12:57 pm, Michael Beattie <[email protected]> wrote: >> What do you mean? If it's programatically then why not use a loop or >> something? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
