presentations/highlight-js/test/detect/clojure/default.txt

12 lines
282 B
Text
Raw Permalink Normal View History

2018-12-07 08:48:05 -06:00
(def ^:dynamic chunk-size 17)
(defn next-chunk [rdr]
(let [buf (char-array chunk-size)
s (.read rdr buf)]
(when (pos? s)
(java.nio.CharBuffer/wrap buf 0 s))))
(defn chunk-seq [rdr]
(when-let [chunk (next-chunk rdr)]
(cons chunk (lazy-seq (chunk-seq rdr)))))