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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Wow. I spent a whole hour trying to figure this out!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.