 
 (defn ns-form? [form]
   (and (seq? form) (= 'ns (first form))))
+
+(defn extract-namespace
+  [source]
+  (let [first-form (repl-read-string source)]
+    (when (ns-form? first-form)
+      (second first-form))))
 
 (def special-doc-map
   '{.     {:forms [(.instanceMethod instance args*)

              source-text
              (if expression? "Expression" "File")
              (merge
                {:ns           @current-ns
                 :source-map   false
                 :verbose      (:verbose @app-env)
                 :cache-source (fn [x cb]
                                 #_(when (and path (:source x))
                                     (js/PLANCK_CACHE path (:source x) nil))
                                 (cb {:value nil}))}
                (when expression?
                  {:context       :expr
                   :def-emits-var true}))
              (fn [{:keys [ns value error] :as ret}]
                (if expression?
                  (when-not error

; file here is an alternate parameter denoting a filesystem path
(defn load [{:keys [name macros path file] :as full} cb]
  (if file
    (when-not (load-and-callback! file :clj :calculate-cache-prefix cb)
      (cb nil))
    (if (re-matches #"^goog/.*" path)
      (if-let [goog-path (get (closure-index-mem) name)]
