   supporting .unread and collapsing all of CR, LF, and CRLF to a single
   \\newline."
   [s]
-  (loop [c (.read s)]
+  (loop [c (readers/read-char s)]
     (case c
       \newline :line-start
       nil :stream-end
-      \; (do (.readLine s) :line-start)
+      \; (do (readers/read-line s) :line-start)
       (if (or (Character/isWhitespace c) (identical? c \,))
-        (recur (.read s))
-        (do (.unread s c) :body)))))
+        (recur (readers/read-char s))
+        (do (readers/unread s c) :body)))))
 
 (defn repl-read
   "Default :read hook for repl. Reads from *in* which must either be an

          (load-stream repl-env f res))))))

(defn- wrap-fn [form]
  (cond (and (seq? form) (= 'ns (first form))) identity
        ('#{*1 *2 *3 *e} form) (fn [x] `(cljs.core.pr-str ~x))
        :else (fn [x] `(cljs.core.pr-str
                         (try
                           (let [ret# ~x]
                             (set! *3 *2)
                             (set! *2 *1)
                             (set! *1 ret#)
                             ret#)
                           (catch :default e#
                             (set! *e e#)
                             (throw e#)))))))

(defn- eval-cljs
  "Given a REPL evaluation environment, an analysis environment, and a

  ([repl-env env filename form wrap]
    (evaluate-form repl-env env filename form wrap *repl-opts*))
  ([repl-env env filename form wrap opts]
   (binding [ana/*cljs-file* filename]
     (let [ast (ana/analyze env form opts)
           js (comp/emit-str ast)
           wrap-js
           ;; TODO: check opts as well - David
           (if (:source-map repl-env)
             (binding [comp/*source-map-data*
                       (atom {:source-map (sorted-map)
                              :gen-col 0
                              :gen-line 0})]
               (let [js (comp/emit-str (ana/no-warn (ana/analyze env (wrap form) opts)))
                     t (System/currentTimeMillis)]
                 (str js
                   "\n//# sourceURL=repl-" t ".js"
                   "\n//# sourceMappingURL=data:application/json;base64,"
                   (DatatypeConverter/printBase64Binary
                     (.getBytes
                       (sm/encode
                         {(str "repl-" t ".cljs")
                          (:source-map @comp/*source-map-data*)}
                         {:lines (+ (:gen-line @comp/*source-map-data*) 3)
                          :file (str "repl-" t ".js")
                          :sources-content
                          [(or (:source (meta form))
                             ;; handle strings / primitives without metadata
                             (with-out-str (pr form)))]})
                       "UTF-8")))))
             (comp/emit-str (ana/no-warn (ana/analyze env (wrap form) opts))))]
       (when (= (:op ast) :ns)
         (load-dependencies repl-env
           (into (vals (:requires ast))
             (distinct (vals (:uses ast))))
           opts))
       (when *cljs-verbose*
         ((:print opts) js))
       (let [ret (-evaluate repl-env filename (:line (meta form)) wrap-js)]
         (case (:status ret)
           :error (throw
                    (ex-info (:value ret)
                      {:type :js-eval-error
                       :error ret
                       :repl-env repl-env
                       :form form}))
           :exception (throw
                        (ex-info (:value ret)
                          {:type :js-eval-exception
                           :error ret
                           :repl-env repl-env
                           :form form
                           :js js}))
           :success (:value ret)))))))

(defn load-stream [repl-env filename res]
  (let [env (ana/empty-env)]
