2

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?

roshanvid
  • 793
  • 6
  • 21

1 Answers1

5

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 try C-c C-k instead, which will compile the entire file. Thereafter, C-c C-c will allow you to re-compile the function.

sanityinc
  • 15,002
  • 2
  • 49
  • 43