2

I recently decided to start using Slime/Swank for writing Clojure. I installed Incanter, Clojure, Slime and Swank yesterday by following this blogpost to the letter, which worked fine. However, I'm experiencing a problem getting Slime to find directories and files on the classpath. I'm running Slime using lein swank and slime-connect in Aquamacs on OS X 10.6. I have two questions:

1) I set up a small project to build a game of life simulation. I have a file called grid.clj from doing this earlier, which I put in the project's lib directory. In core.clj I put the following

(ns gof.core
  (:require grid))

(def w (grid.make_grid 8))

Doing C-x C-e after this piece of code gives this error message in the repl:

Could not locate grid__init.class or grid.clj on classpath: 
  [Thrown class java.io.FileNotFoundException]

so I looked at my classpath using

(doseq [p (.getURLs (java.lang.ClassLoader/getSystemClassLoader))] (println (.getPath p)))

which produced this:

/Users/zjanes/Documents/gof/test/
/Users/zjanes/Documents/gof/test-resources
/Users/zjanes/Documents/gof/src/
/Users/zjanes/Documents/gof/classes/
/Users/zjanes/Documents/gof/resources
/Users/zjanes/Documents/gof/lib/clojure-1.3.0.jar
/Users/zjanes/Documents/gof/lib/grid.clj
/Users/zjanes/.lein/plugins/swank-clojure-1.3.4.jar
nil
user> 

It seems to me that grid.clj is on this classpath, so why am I getting the error message?

2) In trying to solve this I had a look at clojure-1.3.0.jar and couldn't find anything that looks like it comes from clojure.contrib. Is contrib not included when installing clojure as described above?

I'm sure it's obvious I'm a complete novice with clojure, so the clearer the answer, and the less presumed knowledge, the better.

For completeness, I've looked at these answers (1 2 3) and this page, plus some googling around.

Thanks in advance

Community
  • 1
  • 1

1 Answers1

0

that tutorial is from 2009 and as far as I can tell it can't be made to work using those instructions.

Clojure contrib has been split up into many sub projects in clojure 1.3 so it no longer exits under that name.

in general clojure namespaces now have two parts, for instance:

(ns gof.core
  (:require [incanter.grid])
Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284