Functions for manipulating and traversing collections
Functions for manipulating and traversing collections
(any-in? pred coll)Returns true if (pred x) is logical true for any x in coll, else false.
Returns true if (pred x) is logical true for any x in coll, else false.
(find-first pred coll)Returns the first x in coll for which (pred x) returns true. returns nil if none is found
Returns the first x in coll for which (pred x) returns true. returns nil if none is found
(into-map coll)(into-map kf coll)(into-map kf vf coll)Transforms coll into a hash-map by using (kf x) as the key and (vf x) as the value for each x in coll vf defaults to identity if not provided if only coll is provided, will assume coll is a list of pairs
Transforms coll into a hash-map by using (kf x) as the key and (vf x) as the value for each x in coll vf defaults to identity if not provided if only coll is provided, will assume coll is a list of pairs
(not-empty? x)Returns true if x is not empty, else false.
Exists because doing (not (empty? x)) is inefficient
Returns true if x is not empty, else false. Exists because doing (not (empty? x)) is inefficient
(strict-partition n coll)Like parition, but throws an exception if the number of elements in coll are not evenly divisible by n, instead of partition's behavior of having the last group be too small.
Like parition, but throws an exception if the number of elements in coll are not evenly divisible by n, instead of partition's behavior of having the last group be too small.
(take-range start
end
coll
&
{:keys [include-start? include-end?]
:or {include-start? true include-end? false}})Returns the part of the coll from index start to end.
Defaults to start being inclusive and end being exclusive, but can be changed with keyword options.
Returns the part of the coll from index start to end. Defaults to start being inclusive and end being exclusive, but can be changed with keyword options.
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 |