Liking cljdoc? Tell your friends :D

co.multiply.pathling.util

Internal utilities for Pathling. Not part of the public API.

Internal utilities for Pathling. Not part of the public API.
raw docstring

acc-append!clj/smacro

(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.
raw docstring

acc-append-many!clj/smacro

(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.
raw docstring

acc-getclj/smacro

(acc-get acc idx)

Get element at index position from the accumulator.

Get element at index position from the accumulator.
raw docstring

acc-init-append!clj/smacro

(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.
raw docstring

acc-sizeclj/smacro

(acc-size acc)

Return the number of elements in the accumulator.

Return the number of elements in the accumulator.
raw docstring

accumulatorclj/smacro

(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).
raw docstring

accumulator->listclj/s

(accumulator->list acc)

Convert an accumulator to a list.

Convert an accumulator to a list.
raw docstring

accumulator->vecclj/s

(accumulator->vec acc)

Convert an accumulator to a persistent vector.

Convert an accumulator to a persistent vector.
raw docstring

arr-push!cljs

(arr-push! arr v)

cohortsclj/s

(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 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.

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.
raw docstring

editable?clj/s

(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.
raw docstring

extend-protocol-manyclj/smacro

(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] ...))
raw docstring

forvclj/smacro

(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.
raw docstring

with-transientclj/smacro

(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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close