Clojure, Slime, Documentation?
Update: It turns out that the Gutsy-included version of slime is rather out-of-date, and the clojure scripts are based on the CVS version. If you’re having the problem below, get thee hence and cvs thyself.
There seems to be a general theme in the emacs world. If I could give it a voice, it might say “I’m great. No, I’m not going to tell you how to use me. You mean you don’t already know?”
Let me put this in context. You might be able to tell from my previous posts that I’ve got a long-standing, from-a-distance interest in all things lispy. Naturally, my attention fell on Clojure (fairly recently, admittedly). My next thought was that I should get slime set up to use it so that I could use a natural environment to try it out, and this is where things started to get dicey.
Almost everything works; here’s the relevant section from my .emacs:
(defun set-clojure-inferior-lisp ()
(setq inferior-lisp-program
(let* ((java-path "java")
(java-options "")
(clojure-path "~/Documents/Projects/clojure/bin/")
(class-path-delimiter ";")
(class-path (mapconcat (lambda (s) s)
(list (concat
clojure-path "clojure.jar"))
class-path-delimiter)))
(concat java-path
" " java-options
" -cp " class-path
" clojure.lang.Repl"))))
(defun clojure-boot ()
(interactive)
(require 'slime)
(setq slime-net-coding-system 'utf-8-unix)
(slime-setup)
(add-to-list 'load-path "~/emacs/clojure-mode")
(require 'clojure-auto)
(set-clojure-inferior-lisp)
(setq slime-lisp-implementations
'((clojure ("~/emacs/clojure-extra/sh-script/clojure")
:init clojure-init)))
(add-to-list 'load-path "~/emacs/swank-clojure")
(require 'swank-clojure)
(cua-mode t)
(slime))
The annoying thing is what doesn’t work: exceptions are getting lost, and the error message that comes back for each and every one is distinctly unhelpful:
error in process filter: Wrong number of arguments: nil, 3
Where do I go from here? Google knows nothing of this error. I’ve emailed the author of the swank-clojure code for assistance; I’ll update here if I get anywhere with this. It’s really frustrating to be this close to what looks like a brilliant development environment, just to hit a brick wall like this.
June 26th, 2008 at 7:42 pm
Follow the directions in: swank-clojure.clj
I just got it working…
June 27th, 2008 at 8:53 am
Yep, I’m an idiot. I’d assumed that slime didn’t move too fast.
June 27th, 2008 at 3:55 pm
Yeah, if emacs’s motto is “I’m great. No, I’m not going to tell you how to use me. You mean you don’t already know?”, then Common Lisp library/tools motto is “I’m great, but you have to get the latest version from darcs/svn/cvs/mg/git.
If you’re into Common Lisp checkout clbuild. It’s awesome…
http://common-lisp.net/project/clbuild/
Enjoy.
July 1st, 2008 at 6:01 pm
I’ve seen clbuild before – it’s just another thing that’s on the Great Long List Of Things To Try When I Get A Spare Afternoon. The thing is, I might have an immediate use for lisp on the JVM, whereas I’m always left wondering what project I can find that might be a good fit for common lisp.
January 13th, 2009 at 12:47 pm
Could you publish the solution to the problem?
I’ve just taken the latest version of everything, following the instruction from:
http://riddell.us/clojure/
January 13th, 2009 at 12:56 pm
My solution was to install everything from CVS. I haven’t tried those instructions, so I don’t know if the problem you’ve got is the same as the one I hit.