I'm trying to pretty print a list of namespaces:
(doseq [x (all-ns)] (println x))
This prints each namespace as #<Namespace xxxxx>. I would like to get each namespace as xxxxx (that is without the #<Namespace>. I tried to (name x), (symbol x) but I get ClassCastException clojure.lang.Namespace cannnot be cast to java.lang.Named, etc.
(doseq [x (all-ns)] (println (name x)))
(doseq [x (all-ns)] (println (str x)))
(doseq [x (all-ns)] (println (namespace x)))
How can I get the namespace as a string?
(doseq [x (all-ns)] (println (str x)))does work, I did have a typo when I tried. Butns-nameas pointed in the answers is the function to use, better thanstr