   (:a {:a "hello"})
   (:a {:a :b})
   (reduce + [1 2 3 4 5])
+  (time (reduce + [1 2 3 4 5]))
   (even? :a)
   (throw (js/Error. "There was an error"))
   (load-file "clojure/string.cljs")

          (swap! loaded-libs (partial apply conj) missing)))))

(defn rhino-setup [repl-env]
  (let [env {:context :statement :locals {}}]
    (repl/load-file repl-env "cljs/core.cljs")
    (swap! loaded-libs conj "cljs.core")
    (repl/evaluate-form repl-env
                        (assoc env :ns (@comp/namespaces comp/*cljs-ns*))
                        "<cljs repl>"
                        '(ns cljs.user))))

(extend-protocol repl/IJavaScriptEnv
  clojure.lang.IPersistentMap

            [cljs.compiler :as comp]
            [cljs.repl :as repl])
  (:import cljs.repl.IJavaScriptEnv
           [org.mozilla.javascript Context ScriptableObject]))

(def current-repl-env (atom nil))
(def loaded-libs (atom #{}))
