       (swap! namespaces update-in [(-> env :ns :name) :defs sym]
              (fn [m]
                (let [m (assoc (or m {}) :name name)]
-                 (if-let [line (:line env)]
-                   (-> m
-                       (assoc :file *cljs-file*)
-                       (assoc :line line))
-                   m))))
+                 (merge m
+                   (when tag {:tag tag})
+                   (when-let [line (:line env)]
+                     {:file *cljs-file* :line line})))))
       (merge {:env env :op :def :form form
               :name name :doc doc :init init-expr}
+             (when tag {:tag tag})
              (when init-expr {:children [init-expr]})
              (when export-as {:export export-as})))))
 


(defmethod parse 'def
  [op env form name]
  (let [pfn (fn ([_ sym] {:sym sym})
              ([_ sym init] {:sym sym :init init})
              ([_ sym doc init] {:sym sym :doc doc :init init}))
        args (apply pfn form)
        sym (:sym args)]
    (assert (not (namespace sym)) "Can't def ns-qualified name")
    (let [env (let [ns-name (-> env :ns :name)]
                (if (or (and (not= ns-name 'cljs.core)

   (let [enve (assoc env :context :expr)
         fexpr (analyze enve f)
         argexprs (vec (map #(analyze enve %) args))]
     {:env env :op :invoke :f fexpr :args argexprs
      :children (conj argexprs fexpr) :tag (-> fexpr :info :tag)})))

(defn analyze-symbol
  "Finds the var associated with sym"
