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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -