(->PushbackReader rdr buf buf-len buf-pos)
Positional factory function for class oakclojure.tools.reader.reader_types.PushbackReader.
Source
(deftype PushbackReader
[rdr ^"[Ljava.lang.Object;" buf ^long buf-len ^:unsynchronized-mutable ^long buf-pos]
Reader
(read-char [reader]
(char
(if (< buf-pos buf-len)
(let [r (aget buf buf-pos)]
(update! buf-pos inc)
r)
(read-char rdr))))
(peek-char [reader]
(char
(if (< buf-pos buf-len)
(aget buf buf-pos)
(peek-char rdr))))
IPushbackReader
(unread [reader ch]
(when ch
(if (zero? buf-pos) (throw (RuntimeException. "Pushback buffer is full")))
(update! buf-pos dec)
(aset buf buf-pos ch)))
Closeable
(close [this]
(when (instance? Closeable rdr)
(.close ^Closeable rdr))))