- ► 2013 (53)
- ► 2010 (44)
Wednesday, November 18, 2009
Installing Clojure on Ubuntu 9.10 (Karmic Koala)
I have a nice fresh Ubuntu installation, on which I want to install Clojure, Emacs, and Slime. And I thought I'd document how it went:
There are packages for some things, but for this stuff I'd rather install bleeding edge versions by hand.
Instructions are here
First install clojure and clojure-contrib
That all goes swimmingly.
Now we need emacs
Again, all is well, except that it's easier to use emacs to modify the .emacs file,
and his default font is the same as the usual one, only far too small on my machine, so I don't bother with that.
Now we have working up-to-date emacs and clojure.
On to the tricky bit, slime.
The instructions for installing swank and slime are here:
Everything worked ok down to the "Test Configuration" section, where you use C-c C-k to compile the demo program ants.clj.
Nothing happens, and it rapidly becomes obvious that something is wrong.
It turns out that a recent change to slime broke clojure support.
To revert slime to the version just before the breaking change, use
git checkout -b prebroken 33708dbf01adec2a91d198a798afed5032cdceca
Which creates a new branch, prebroken, at the last working version and changes the files in ~/opt/slime to be those that were then extant.
Thanks to Lauri below. I assume that's Lauri Pesonen?
Right, having reverted to the old version of slime, it all works.
As you evaluate each line in the ants file, a new thing happens in the window!
Description of the bug caused by latest changes to slime:
If I start a new emacs, then M-x starts slime and seems to connect to a REPL.
But at this REPL,
; Evaluation aborted.
Even better. I'm looking at a clojure stack trace. q gets out, like it should.
So is that
user> (list 2 3 4)
Now everything seizes up.
This turns out to be related to a new feature of slime allowing it to highlight keyword arguments, or something.
The clojure version of swank can't deal with this new change and responds by hanging.
Presumable some wise persons will fix this eventually. For the moment just use a slightly out of date slime.