var
(var symbol)
Source docstring:
The symbol must resolve to a var, and the Var object
itself (not its value) is returned. The reader macro #'x expands to (var x).
(defmethod parse 'var
[op env [_ sym :as form] _ _]
(when (not= 2 (count form))
(throw (error env "Wrong number of args to var")))
(when-not (symbol? sym)
(throw (error env "Argument to var must be symbol")))
(merge
{:env env
:op :the-var
:children [:var :sym :meta]
:form form}
(var-ast env sym)))
(defmethod emit* :the-var
[{:keys [env var sym meta] :as arg}]
{:pre [(ana/ast? sym) (ana/ast? meta)]}
(let [{:keys [name]} (:info var)]
(emit-wrap env
(emits "new cljs.core.Var(function(){return " (munge name) ";},"
sym "," meta ")"))))