clojure.core/*ns*¶
A clojure.lang.Namespace object representing the current namespace.
Examples¶
Note by gstamp¶
A trap I fell into was that ns seems to get assigned to clojure.core when run as a "gen-class" compiled class.
Note by Artiavis¶
To clarify the above point, see my example above. Although within Lein/Boot/REPL/Compiler contexts, *ns* is thread-local due to the use of the binding machinery, and so in-ns works in those situtations, *ns* has a root of clojure.core. That means that, at runtime, you cannot call in-ns within functions until you've first called binding. (This could be relevant for e.g. eval calls.)
Content from the matching ClojureDocs page, with authors credited on each contribution.