Internal utilities for Pathling. Not part of the public API.
Internal utilities for Pathling. Not part of the public API.
(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. Use when accumulator may not be needed (avoids allocation in common case). Returns the (possibly new) accumulator.
Append a value to the accumulator, lazily initializing if nil. Use when accumulator may not be needed (avoids allocation in common case). Returns the (possibly new) accumulator.
(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 accumulator for efficient mutable collection. 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 accumulator for efficient mutable collection. 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.
(arr-push! arr v)(cohorts pred coll)Gather elements into piles by collecting elements matched by pred, and
all elements succeeding it, until the next match of pred.
The predicate function receives two arguments:
item: The current element being evaluatedprev-match: The previous element that matched the predicate (or nil for the first match)The first entry will contain all items leading up to the first match of pred.
Empty if pred is matched on the first element.
Gather elements into piles by collecting elements matched by `pred`, and all elements succeeding it, until the next match of `pred`. The predicate function receives two arguments: - `item`: The current element being evaluated - `prev-match`: The previous element that matched the predicate (or nil for the first match) The first entry will contain all items leading up to the first match of `pred`. Empty if `pred` is matched on the first element.
(editable? v)Check if a collection supports transient operations (implements IEditableCollection). Regular maps, vectors, and sets return true. Sorted collections and subvec return false.
Check if a collection supports transient operations (implements IEditableCollection). Regular maps, vectors, and sets return true. Sorted collections and subvec return false.
(extend-protocol-many protocol & groups)Extend a protocol to multiple types with the same implementation. Supports multiple type groups, each with their own method implementations.
Usage: (extend-protocol-many Scannable [List EmptyList LazySeq] (method1 [this] ...) (method2 [this x] ...)
[PersistentArrayMap PersistentHashMap]
(method1 [this] ...)
(method2 [this x] ...))
Extend a protocol to multiple types with the same implementation.
Supports multiple type groups, each with their own method implementations.
Usage:
(extend-protocol-many Scannable
[List EmptyList LazySeq]
(method1 [this] ...)
(method2 [this x] ...)
[PersistentArrayMap PersistentHashMap]
(method1 [this] ...)
(method2 [this x] ...))(forv [bind-to coll] & body)Like for, but returns a vector. No bells and whistles.
Like `for`, but returns a vector. No bells and whistles.
(with-transient [k v] & body)Execute body with a transient version of the collection, then persist. Preserves metadata from the original collection.
Execute body with a transient version of the collection, then persist. Preserves metadata from the original collection.
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 |