     (compile-file "/tmp/somescript.cljs")
     (slurp "/tmp/somescript.js")))
 
-(defn- path-seq
+(defn path-seq
   [file-str]
   (string/split file-str (re-pattern java.io.File/separator)))
 

(defn dependency-order-visit
  [state ns-name]
  (let [file (get state ns-name)]
    (if (:visited file)
      state
      (let [state (assoc-in state [ns-name :visited] true)
            deps (:requires file)

                         *cljs-ns* 'cljs.user]
                 (loop [forms (forms-seq src-file)
                        ns-name nil
                        deps {'cljs.core 'cljs.core}]
                   (if (seq forms)
                     (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}
                           ast (analyze env (first forms))]
                       (do (emit ast)
                           (if (= (:op ast) :ns)
                             (recur (rest forms) (:name ast) (merge deps (:requires ast)))
                             (recur (rest forms) ns-name deps))))
                     {:ns (or ns-name 'cljs.user) :requires (vals deps) :file dest-file})))))
         (throw (java.io.FileNotFoundException. (str "The file " src " does not exist.")))))))

(comment
