(resolve-sym sym {:keys [ns], :as env})
Resolves the value mapped by the given sym in the global env
Source
(defn resolve-sym
"Resolves the value mapped by the given sym in the global env"
[sym {:keys [ns] :as env}]
(when (symbol? sym)
(let [sym-ns (when-let [ns (namespace sym)]
(symbol ns))
full-ns (resolve-ns sym-ns env)]
(when (or (not sym-ns) full-ns)
(let [name (if sym-ns (-> sym name symbol) sym)]
(-> (env/deref-env) :namespaces (get (or full-ns ns)) :mappings (get name)))))))