type | since v0.0-1424 | clojure.lang/ArrayChunk | Edit |
(ArrayChunk. arr off end)
(deftype ArrayChunk [arr off end]
ICounted
(-count [_] (- end off))
IIndexed
(-nth [coll i]
(aget arr (+ off i)))
(-nth [coll i not-found]
(if (and (>= i 0) (< i (- end off)))
(aget arr (+ off i))
not-found))
IChunk
(-drop-first [coll]
(if (== off end)
(throw (js/Error. "-drop-first of empty chunk"))
(ArrayChunk. arr (inc off) end)))
IReduce
(-reduce [coll f]
(array-reduce arr f (aget arr off) (inc off)))
(-reduce [coll f start]
(array-reduce arr f start off)))