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)
Returns the part of the coll from index start (inclusive) to end (exclusive).
Returns the part of the coll from index start (inclusive) to end (exclusive).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close