Understanding what happens when I send a form to the REPL


I don’t understand loading namespaces and var bindings with respect to sending forms to the REPL.

Here’s a gist with my REPL session and my notes/questions in the form of comments there.

I solved the “no such namespace” error by sending the ns form to the REPL, but clearly I don’t understand the difference between ns :require and require. Would Navigating Namespaces at the REPL help me understand what’s going on?

What’s going on with the “var unbound” error?


Hi @brentvukmer,

Thanks for the question.

I’m not sure why the alias isn’t working. It may have something to do with the way Cursive works. The call to require works fine for me in the normal Leiningen command-line REPL. It is weird though that it doesn’t work at first, then evaluating the current namespace makes it work. I wonder if it’s a known Cursive bug.

The last part is simpler, where you can’t refer to halloween-2016. It’s because you define it in the user namespace, then change namespaces. ns defines a namespace and changes to it. You will need to define halloween-2016 again in the new namespace.



Thanks, @ericnormand - I will ask the Cursive list.


I feel like a dummy for not noticing the namespace change. Thanks!