I am launching a test application with
lein run using the following code:
(ns test.core (:gen-class)) (defn -main "Print the current namespace" [& args] (println *ns*))
I expected to get the
test.core namespace, but instead it printed:
#object[clojure.lang.Namespace 0x5ffc5491 user]
lein trampoline run as well but I got the same result.
By adding the line
(in-ns 'test.core) I can get the results I expect, but I am still curious about the previous behavior.
Is this a side effect of using leiningen?
Should I always put
(in-ns 'test.core) into my code just in case if I always want the namespace to be the namespace of my main function?