Manipulation of sequences
Manipulation of sequences
(concat-at x kw y)
Concatenate sequences x
and y
, y
is inserted at position kw
.
If kw
not found, y
is concatenated at the end of x
.
Concatenate sequences `x` and `y`, `y` is inserted at position `kw`. If `kw` not found, `y` is concatenated at the end of `x`.
(index-of coll pred)
Find the position of x, the first occurence matching(x) in coll.
Returns its position Params:
coll
collection to search inpred
pred is a function returning true when called on the element to return the sequence ofFind the position of x, the first occurence matching(x) in coll. Returns its position Params: * `coll` collection to search in * `pred` pred is a function returning true when called on the element to return the sequence of
(indexed s)
Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero.
(indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])
Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero. (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])
(position-by-values v)
Returns a map which associates each value of the vector to the positions where it happens.
Params:
v
Returns a map which associates each value of the vector to the positions where it happens. Params: * `v`
(positions pred coll)
Returns a lazy sequence containing the positions at which pred is true for items in coll.
Returns a lazy sequence containing the positions at which pred is true for items in coll.
(trim-leading-nil aseq)
(trim-leading-nil aseq nil-fn)
Remove nil values at the end of a sequence Params:
aseq
a sequence which will be tested starting from the endnil-fn
is the function to test nullity, (defaulted to nil?
)Remove nil values at the end of a sequence Params: * `aseq` a sequence which will be tested starting from the end * `nil-fn` is the function to test nullity, (defaulted to `nil?`)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close