(all-after item coll)
Returns a new collection of all items after item
in original coll
.
If coll
is a vector, the new collection is created with subvec
.
Returns original coll if item isn't found.
Returns a new collection of all items after `item` in original `coll`. If `coll` is a vector, the new collection is created with `subvec`. Returns original coll if item isn't found.
(apply-to-keys type keys f & args)
Applies f
with args
to all given keys
in type
.
Applies `f` with `args` to all given `keys` in `type`.
(cartesian-product & seqs)
All the ways to take one item from each sequence (taken from clojure.contrib.combinatorics)
All the ways to take one item from each sequence (taken from clojure.contrib.combinatorics)
(demunge-flags kw xs)
Takes a keyword or string and string/seq of items, returns map with
items as keys and boolean values indicating if an item has been
found in the string representation of the kw. If kw
is nil, returns
nil.
(demunge-flags :cad "abcd")
#_=> {:a true :b false :c true :d true}
Takes a keyword or string and string/seq of items, returns map with items as keys and boolean values indicating if an item has been found in the string representation of the kw. If `kw` is nil, returns nil. (demunge-flags :cad "abcd") #_=> {:a true :b false :c true :d true}
(demunge-flags-seq kw xs)
Like demunge-flags
but returns lazyseq of booleans in same order as xs.
(demunge-flags-seq :cad "abcd") #_=> [true false true true]
Like `demunge-flags` but returns lazyseq of booleans in same order as xs. (demunge-flags-seq :cad "abcd") #_=> [true false true true]
(filter-tree f root)
Applies f
to root coll and every of its (nested) elements. Returns
a vector of items for which f
returned a truthy value.
Applies `f` to root coll and every of its (nested) elements. Returns a vector of items for which `f` returned a truthy value.
(successive-nth n coll)
(successive-nth n step coll)
Returns a lazyseq of n
-element vectors, each one containing
a successive elements of the original collection.
(successive-nth 3 [1 2 3 4])
=> ([1 2 3] [2 3 4] [3 4 5])
Returns a lazyseq of `n`-element vectors, each one containing a successive elements of the original collection. (successive-nth 3 [1 2 3 4]) => ([1 2 3] [2 3 4] [3 4 5])
(successive-nth-indexed n coll)
(successive-nth-indexed n idx coll)
Returns a lazyseq of nested 2-element vectors, each one containing
a vector of n
successive elements of the original collection and
an sequence index.
(successive-nth-indexed 2 [10 20 30 40])
=> ([[10 20] 0] [[20 30] 1] [[30 40] 2])
Returns a lazyseq of nested 2-element vectors, each one containing a vector of `n` successive elements of the original collection and an sequence index. (successive-nth-indexed 2 [10 20 30 40]) => ([[10 20] 0] [[20 30] 1] [[30 40] 2])
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close