Protocol for applying updates through navigation structure
Protocol for applying updates through navigation structure
(apply-updates nav data f)Sentinel value that signals removal of an element from its parent collection. Return this from an update-paths transform function to remove the element.
Behavior by collection type:
Example: (transform-when data number? #(if (neg? %) REMOVE (inc %))) ;; Removes negative numbers, increments positive ones
Sentinel value that signals removal of an element from its parent collection. Return this from an update-paths transform function to remove the element. Behavior by collection type: - Maps: the key-value pair is removed (dissoc) - Sets: the element is not added to the result - Vectors/Lists: the element is removed and indices collapse Example: (transform-when data number? #(if (neg? %) REMOVE (inc %))) ;; Removes negative numbers, increments positive ones
(find-when this matches pred opts)Scan for matches without navigation.
Scan for matches without navigation.
(path-when this matches pred opts)Scan for matches, building navigation.
Scan for matches, building navigation.
(vec-remove-indices* v indices cast)(vec-remove-indices* v indices cast metadata)Remove elements at specified indices from a vector using efficient subvec splicing.
Arguments:
Constraints (not validated - caller must ensure):
Remove elements at specified indices from a vector using efficient subvec splicing. Arguments: - v: the source vector - indices: an accumulator (ArrayList) of indices to remove, or nil for no removals - cast: function to convert the result (e.g., accumulator->vec) - metadata: optional metadata to attach to the result Constraints (not validated - caller must ensure): - indices must be sorted in ascending order - indices must be unique (no duplicates) - indices must be within bounds [0, (dec (count v))]
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 |