Liking cljdoc? Tell your friends :D

utilis.coll


distinct-byclj/s

(distinct-by f)
(distinct-by f coll)

Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f. Returns a transducer when no collection is provided.

Returns a lazy sequence of the elements of coll, removing any elements that
return duplicate values when passed to a function f. Returns a transducer
when no collection is provided.
raw docstring

insert-atclj/s

(insert-at coll index item)

Inserts item into the coll at index. Items already in coll after index are shifted forward to accommodate item.

It is the responsibility of the caller to ensure that the index is within bounds.

Inserts `item` into the `coll` at `index`. Items already in `coll` after
`index` are shifted forward to accommodate `item`.

It is the responsibility of the caller to ensure that the index is within
bounds.
raw docstring

key-byclj/s

(key-by key-fn coll)

Returns a map whose keys are the value returned by the key-fn applied to each value in the coll. If the key-fn returns a key more than once, the last value is used.

Returns a map whose keys are the value returned by the `key-fn`
applied to each value in the coll.  If the `key-fn` returns a key
more than once, the last value is used.
raw docstring

llastclj/s

(llast nested-coll)

Returns the last item of the last collection.

Returns the last item of the last collection.
raw docstring

nth-lastclj/s

(nth-last coll index)
(nth-last coll index default)

Returns the nth last item in the collection. Throws an exception if the index is out of bounds unless default is supplied.

Returns the nth last item in the collection.  Throws an exception if
the index is out of bounds unless `default` is supplied.
raw docstring

onlyclj/s

(only s)
(only s exception-message)

Returns the first element from s iff it's the only element in s. If s does not contain exactly 1 element, an IllegalAgumentException or js/Error is thrown. The message for the exceptions can be optionally specified.

Returns the first element from `s` iff it's the only element in `s`.
If `s` does not contain exactly 1 element, an IllegalAgumentException
or js/Error is thrown. The message for the exceptions can be optionally
specified.
raw docstring

partition-allclj/s

(partition-all n)
(partition-all n step)
(partition-all n step coll)

Returns a transducer for the [n] and [n step] arities.

Returns a transducer for the [`n`] and [`n` `step`] arities.
raw docstring

remove-atclj/s

(remove-at coll index)

Removed the item at index from coll. Subsequent items are shifted to ensure that there are no gaps in the collection.

It is the responsibility of the caller to ensure that the index is within bounds.

Removed the item at `index` from `coll`. Subsequent items are shifted
to ensure that there are no gaps in the collection.

It is the responsibility of the caller to ensure that the index is within
bounds.
raw docstring

second-lastclj/s

(second-last coll)

Returns the second last item in the collection.

Returns the second last item in the collection.
raw docstring

take-untilclj/s

(take-until pred coll)

Returns a lazy sequence of successive items from coll until (pred item) returns logical true. The last item, which returned true, is included in the output. pred must be free of side-effects. Transducer not implemented.

Returns a lazy sequence of successive items from coll until
(pred item) returns logical true. The last item, which returned
true, is included in the output.  pred must be free of
side-effects.  Transducer not implemented.
raw docstring

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

× close