I'm trying to write a helloworld with clojure. I'm using leinengen with emacs and swank-clojure.
Here's what my src/hello.clj contains:
(ns hello)
(defn hello []
(println "Hello World"))
When I clojure-jack-in and C-c C-c over the function, I get:
No such namespace: hello
[Thrown class java.lang.Exception]
What am I doing wrong?
With
C-c C-c, you're asking the backend to compile the function at point within the "hello" namespace, but that namespace doesn't yet exists -- you haven't executed the(ns hello)line yet. So tryC-c C-kinstead, which will compile the entire file. Thereafter,C-c C-cwill allow you to re-compile the function.