I recently became interested in Clojure, a (mostly) functional lisp
that runs on the JVM. While reading the documentation and watching
the screencasts, I wanted to start trying out some of the stuff I was
seeing. I use Emacs
for code, on Windows, Linux, and Mac OS, and it is particularly
nice for dynamic languages that provide a REPL.
Here's the super easy way to get started with Clojure on Emacs.
- Install a recent version of Emacs, 22 or 23, if you haven't
already got one. I use Carbon Emacs
on OS X.
- Follow the instructions here: Install the Emacs Lisp
Package Archive (ELPA) script
- Get a list of available packages (optional, but interesting):
M-x package-list-packages
- Install the Slime and Clojure packages:
- M-x package-install clojure-mode
- M-x package-install clojure-test-mode
- M-x package-install swank-clojure
- M-x package-install slime
- Run Clojure in SLIME:M-x slime. You should be asked if
you want to download and install Clojure. Say yes, and let it do it's
thing, and you will eventually see a buffer that looks like this:
; SLIME 20091016
user>
user>
- Read stuff on clojure.org, watch
the screencasts on clojure.blip.tv, and have fun!
- Try out ants.clj as detailed at this
other not so easy Clojure+Slime+Emacs guide. Skip down to the
"Test Configuration" section.
For more information about how Slime works, see this post by Bill
Clementson.
This Emacs+Slime+Clojure
video on Vimeo may also be interesting, although dated.