       {:error     true
        :exception e})))
 
+(defn require [args]
+  "((quote foo.bar) :reload)"
+  (prn "require" args)
+  (cljs.js/require
+    {:*compiler*     (env/default-compiler-env)
+     :*data-readers* tags/*cljs-data-readers*
+     :*load-fn*      load
+     :*eval-fn*      eval}
+    (second (first args))
+    (second args)
+    (fn [res]
+      (println "require result:" res))))
+
 (defn ^:export read-eval-print [line]
   (binding [ana/*cljs-ns* @current-ns
             *ns* (create-ns @current-ns)


(defn load-and-callback! [path extension cb]
  (let [full-path (form-full-path path extension)]
    (cb {:lang   (extension->lang extension)
         :source (planck.io/slurp full-path)})))


(defn ns-form? [form]
  (and (seq? form) (= 'ns (first form))))

(def repl-specials '#{in-ns require doc})

(defn repl-special? [form]
  (and (seq? form) (repl-specials (first form))))

(def repl-special-doc-map
  '{in-ns   {:arglists ([name])
             :doc      "Sets *cljs-ns* to the namespace named by the symbol, creating it if needed."}
    require {:arglists ([& args])
             :doc      "Loads libs, skipping any that are already loaded."}
    doc     {:arglists ([name])
             :doc      "Prints documentation for a var or special form given its name"}})

(defn- repl-special-doc [name-symbol]
  (assoc (repl-special-doc-map name-symbol)
