 
 (defmethod emit :ns
   [{:keys [name requires uses requires-macros env]}]
-  (swap! ns-first-segments conj (first (string/split (str name) #"\.")))
   (emitln "goog.provide('" (munge name) "');")
   (when-not (= name 'cljs.core)
     (emitln "goog.require('cljs.core');"))

    (loop [d 0, {:keys [shadow]} info]
      (cond
       shadow (recur (inc d) shadow)
       (@ns-first-segments (str name)) (inc d)
       :else d))))

(defn munge

  [& args]
  `(.println System/err (str ~@args)))

(defn ns-first-segments []
  (letfn [(get-first-ns-segment [ns] (first (string/split (str ns) #"\.")))]
    (map get-first-ns-segment (keys @ana/namespaces))))

; Helper fn
(defn shadow-depth [s]
