 ;; CLJS Specifics
 
 (defprotocol IReplEnvOptions
-  (-repl-options [this] "Return default REPL options for a REPL Env"))
+  (-repl-options [repl-env] "Return default REPL options for a REPL Env"))
 
 (defprotocol IJavaScriptEnv
-  (-setup [this opts] "initialize the environment")
-  (-evaluate [this filename line js] "evaluate a javascript string")
-  (-load [this provides url] "load code at url into the environment")
-  (-tear-down [this] "dispose of the environment"))
+  (-setup [repl-env opts] "initialize the environment")
+  (-evaluate [repl-env filename line js] "evaluate a javascript string")
+  (-load [repl-env provides url] "load code at url into the environment")
+  (-tear-down [repl-env] "dispose of the environment"))
 
 (extend-type
   Object
   IReplEnvOptions
   (-repl-options [_] nil))
+
+(defprotocol IParseStacktrace
+  (-parse-stacktrace [repl-env stacktrace build-options]
+    "Given the original JavaScript stacktrace string and current compiler build
+     options, parse the stacktrace into the canonical form:
+
+     [{:file <string>
+       :function <string>
+       :line <integer>
+       :column <integer>}*]
+
+     :file must be a URL path (without protocol) relative to :output-dir."))
 
 (defn- env->opts
   "Returns a hash-map containing all of the entries in [repl-env], translating

    (println (:value ret))
    (when-let [st (:stacktrace ret)]
      (if (and (true? (:source-map opts))
               (vector? st))
        (print-mapped-stacktrace st opts)
        (println st))
      (flush))))


  (:ns (ns-info "samples/hello/out/hello/core.js"))

  (print-mapped-stacktrace
    [{:file "hello/core.js"
      :function "first"
      :line 2
      :column 1}]
    {:output-dir "samples/hello/out"})
  )

(defn- display-error
