   ([repl-env ret form opts]
    (display-error repl-env ret form (constantly nil) opts))
   ([repl-env ret form f {:keys [print flush] :as opts}]
-   (f)
-   (when-let [value (:value ret)]
-     (print value))
-   (when-let [st (:stacktrace ret)]
-     (if (and (true? (:source-map opts))
-              (satisfies? IParseStacktrace repl-env))
-       (let [cst (try
-                   (-parse-stacktrace repl-env st ret opts)
-                   (catch Throwable e
-                     (when (:repl-verbose opts)
-                       (print "Failed to canonicalize stacktrace")
-                       (print (Throwables/getStackTraceAsString e))
-                       (flush))))]
-         (if (vector? cst)
-           (if (satisfies? IPrintStacktrace repl-env)
-             (-print-stacktrace repl-env cst ret opts)
-             (print-mapped-stacktrace cst opts))
-           (print st)))
-       (print st))
-     (flush))))
+   (err-out
+     (f)
+     (when-let [value (:value ret)]
+       (print value))
+     (when-let [st (:stacktrace ret)]
+       (if (and (true? (:source-map opts))
+             (satisfies? IParseStacktrace repl-env))
+         (let [cst (try
+                     (-parse-stacktrace repl-env st ret opts)
+                     (catch Throwable e
+                       (when (:repl-verbose opts)
+                         (print "Failed to canonicalize stacktrace")
+                         (print (Throwables/getStackTraceAsString e))
+                         (flush))))]
+           (if (vector? cst)
+             (if (satisfies? IPrintStacktrace repl-env)
+               (-print-stacktrace repl-env cst ret opts)
+               (print-mapped-stacktrace cst opts))
+             (print st)))
+         (print st))
+       (flush)))))
 
 (defn evaluate-form
   "Evaluate a ClojureScript form in the JavaScript environment. Returns a

               :print-no-newline print-no-newline
               :source-map-inline source-map-inline})))]
    (env/with-compiler-env (or compiler-env (env/default-compiler-env opts))
     (binding [ana/*cljs-ns* 'cljs.user
               *cljs-verbose* repl-verbose
               ana/*cljs-warnings*
               (assoc ana/*cljs-warnings*

(defn repl*
  [repl-env {:keys [init need-prompt quit-prompt prompt flush read eval print caught reader
                    print-no-newline source-map-inline wrap repl-requires
                    compiler-env bind-err]
             :or {need-prompt #(if (readers/indexing-reader? *in*)
                                (== (readers/get-column-number *in*) 1)
                                (identity true))
