clojure - How to find the fully qualified namespace of a symbol? -


if have symbol who's namespace alias, q/w, how can find actual namespace, actual.namespace/w ?

i know resolve give me qualified var, don't know how namespace of var.

the best can is:

 (defn fqns [s] (str (get (ns-aliases *ns*) (symbol (namespace s))))) 

surely there's simpler way ?

you can namespace object of symbol shown below (if want name of ns string call str @ end):

(defn fqns [s] (->> (resolve s) meta :ns)) 

Comments