Exiting The REPL In Clojure

Whenever I’m learning a new language, it always seems like it’s the little things that drive me mad. With that in mind, I’m going to try and post fixes to the little things as I make my way through Clojure. To that point, I rapidly got tired of closing down the command window and starting a new one when I seriously hosed things up. Ctrl-D didn’t work though I think that’s the command for Common Lisp. As usual, Google knows everything and the command is Ctrl-C.

Also, if you’re running Clojure on Windows and want to be able to fire up the REPL from anywhere, create a batch file called clojure.bat in your Windows\system32 folder and put the following line in it:
java -cp c:\clojure\clojure.jar clojure.lang.Repl

Then you can just type clojure at the command prompt anywhere and have the REPL start up in that directory. This is helpful once you start writing larger programs that aren’t located in the Clojure install folder.

0 comments on “Exiting The REPL In Clojure

  1. (. System exit 0)

    will do it

  2. If you also want to have a simple shortcut to open the REPL create a shortcut and add this line to target: ‘%JAVA_HOME%jrebinjava.exe -cp “F:clojure_1.0.0clojure-1.0.0.jar;clojure.jar” clojure.lang.Repl’ and this to Start in: ‘%JAVA_HOME%jrebin’
    Please note that the ‘ (single quote is excluded and that this assume that the %JAVA_HOME% path is already set in your environment.

Leave a Reply

Your email address will not be published. Required fields are marked *