Mutable accumulator utilities for efficient collection building. Uses ArrayList on CLJ, JS array on CLJS.
Mutable accumulator utilities for efficient collection building. Uses ArrayList on CLJ, JS array on CLJS.
(acc-append! acc v)Append a single value to the accumulator. Mutates in place, returns the accumulator.
Append a single value to the accumulator. Mutates in place, returns the accumulator.
(acc-append-many! acc many)Append all elements from a sequential collection to the accumulator. Mutates in place, returns the accumulator.
Append all elements from a sequential collection to the accumulator. Mutates in place, returns the accumulator.
(acc-get acc idx)Get element at index position from the accumulator.
Get element at index position from the accumulator.
(acc-init-append! acc v)Append a value to the accumulator, lazily initializing if nil. Returns the (possibly new) accumulator.
Append a value to the accumulator, lazily initializing if nil. Returns the (possibly new) accumulator.
(acc-set! acc idx v)Set element at index position in the accumulator. Returns the value.
Set element at index position in the accumulator. Returns the value.
(acc-size acc)Return the number of elements in the accumulator.
Return the number of elements in the accumulator.
(accumulator)(accumulator initial-size)Create a new mutable accumulator. Optionally accepts an initial-size for preallocation when final size is known. In ClojureScript, returns a raw JS array (preallocation hint is ignored).
Create a new mutable accumulator. Optionally accepts an initial-size for preallocation when final size is known. In ClojureScript, returns a raw JS array (preallocation hint is ignored).
(accumulator->list acc)Convert an accumulator to a list.
Convert an accumulator to a list.
(accumulator->vec acc)Convert an accumulator to a persistent vector.
Convert an accumulator to a persistent vector.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |