Clojure, Slime, Documentation?

Thursday, June 26th, 2008

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.

Entries (RSS)