Search code examples
fileclojurestoreread-eval-print-loop

Store Clojure REPL lines


Maybe this is a newbee question, sorry if so!

Is it possible to store all lines I typed into the REPL in a file? Maybe one can configure it to do so or do this before closing the REPL session.

Thanks for your answer!


Solution

  • Leiningen stores history by default when in a project:

    $ lein new hello
    $ cd hello
    $ lein repl
    user=> (+ 1 2 3)
    user=> (exit)
    $ cat .lein-repl-history
    

    Boot always stores history by default:

    $ boot repl
    boot.user=> (+ 1 2 3)
    boot.user=> (exit)
    $ cat .nrepl-history