Liking cljdoc? Tell your friends :D

co.multiply.pathling.helper

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

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

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.
sourceraw 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.
sourceraw 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:

```clojure
(extend-protocol-many Scannable
  [List EmptyList LazySeq]
  (method1 [this] ...)
  (method2 [this x] ...)

  [PersistentArrayMap PersistentHashMap]
  (method1 [this] ...)
  (method2 [this x] ...))
```
sourceraw 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.
sourceraw docstring

with-transientclj/smacro

(with-transient [k v] & body)

Execute body with a transient version of the collection, then persistent!. Preserves metadata from the original collection.

Execute body with a transient version of the collection, then `persistent!`.
Preserves metadata from the original collection.
sourceraw 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