Liking cljdoc? Tell your friends :D

automaton-core.utils.sequences

Manipulation of sequences

Manipulation of sequences
raw docstring

concat-atclj/s

(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`.
raw docstring

index-ofclj/s

(index-of coll pred)

Find 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
Find 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
raw docstring

indexedclj/s

(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])
raw docstring

position-by-valuesclj/s

(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`
raw docstring

positionsclj/s

(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.
raw docstring

trim-leading-nilclj/s

(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 end
  • nil-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?`)
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close