what is the parameter to ns ? the documentation says something, but it's not clear (to me, at least)
my-new-namespace=> (doc ns)
-------------------------
clojure.core/ns
([name docstring? attr-map? references*])
Macro
Sets *ns* to the namespace named by name (unevaluated), creating it
if needed.
...the rest of the documentation was not copied
the confusion comes from all the other functions that play with namespaces:
user=> (find-ns 'my-new-namespace)
nil
user=> (remove-ns 'my-new-namespace)
nil
user=> (create-ns 'my-new-namespace)
#<Namespace my-new-namespace>
user=> (ns 'my-new-namespace)
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:26)
user=> (ns my-new-namespace)
nil
my-new-namespace=>
find-ns, create-ns, remove-ns
take my-new-namespace
quoted, while ns
takes my-new-namespace
unquoted
so, what is the deal ? why some get a quoted form and others get and unquoted form of my-new-namespace
?
what is, in each case, my-new-namespace
?
ps: think i figured out the answer to this as i was writing the question here, but it seemed and interesting exercise, so the question still got posted :D