Clojure has been getting a bit of press recently, such as prominence on the ThoughtWorks Technology Radar. Having spent some time learning Lisp in the past, I thought it could be a good holiday project to play with.
This post pulls together some of the resources I found for getting started. I’m not going to try and sell you on a Lisp dialect that integrates into the JVM, it should be self evident.
cd ~/Library/Application\ Support/TextMate/Bundles git clone git://github.com/nullstyle/clojure-tmbundle.git Clojure.tmbundle osascript -e 'tell app "TextMate" to reload bundles'
Then create a folder, open it in TextMate, create a file (ie.
test.clj) and put some sample code into it:
(+ 1 2 3) (println "Hello from the console") (. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))
Put the cursor into one of the expressions and press Apple-R. TextMate will figure the rest out and show the result. Apple-Shift-R will run all the expressions.
(The Vim setup looks really good, but I’m committed to learning TextMate at the moment)
Given that Clojure is Lisp based, it would make sense to understand Lisp. The best option is a book called Practical Common Lisp. This is available on the web for free, or can be purchased from Amazon.
Update: Apparently I was off a bit on the utility of the Common Lisp book.