 
 (defn read-unquote
   [rdr comma]
-  (if-let [ch (char (peek-char rdr))]
+  (if-let [ch (peek-char rdr)]
     (if (identical? \@ ch)
       ((wrapping-reader 'clojure.core/unquote-splicing) (doto rdr read-char) \@)
       ((wrapping-reader 'clojure.core/unquote) rdr \~))))

(defn read-regex
  [rdr ch]
  (let [sb (StringBuilder.)]
    (loop [ch (char (read-char rdr))]
      (if (identical? \" ch)
        (Pattern/compile (str sb))
        (if (nil? ch)
          (reader-error rdr "EOF while reading regex")
          (do (.append sb ch)
              (if (identical? \\ ch)
                (let [ch (char (read-char rdr))]
                  (if (nil? ch)
                    (reader-error rdr "EOF while reading regex"))
                  (.append sb ch)
                  (recur (char (read-char rdr))))
                (recur (char (read-char rdr))))))))))

(defn read-discard
  [rdr _]

(declare newline?)

(defn- normalize-newline [rdr ch]
  (if (identical? \return ch)
    (let [c (peek-char rdr)]
      (when (identical? \formfeed c)
        (read-char rdr))
      \newline)
    ch))

(deftype IndexingPushbackReader
    [rdr ^:unsynchronized-mutable line ^:unsynchronized-mutable column
     ^:unsynchronized-mutable line-start? ^:unsynchronized-mutable prev]
  Reader
  (read-char [reader]
    (when-let [ch (read-char rdr)]
      (let [ch (normalize-newline rdr ch)]
        (set! prev line-start?)
        (set! line-start? (newline? ch))
