(defn qualify
"Convert a symbol to a qualified symbol. If the
symbol does not already refer to an existing var,
default to the current namespace."
[sym]
(let [res (resolve sym)
ns (or (and res (-> res (meta) (:ns) (.name) (name)))
(-> *ns* (.name) (name)))
nme (name sym)]
(symbol ns nme)))
I would like to know how to convert this so that it can be called from within a clojurescript macro. I know that all cljs macros must actually be written in clj. How do I access this kind of information when compiling cljs?
As long as I restrict this defn to clj only, it will work in a clojurescript macro.