Liking cljdoc? Tell your friends :D

ext.core


assoc-defaultclj

(assoc-default m default k v & kvs)

Just like the built-in 'assoc', except that a default type can be passed. If the passed-in map doesn't exist (is falsey), 'default' is called and its return value is used as the map on which assoc is then called.

Just like the built-in 'assoc', except that a default type can be passed.
If the passed-in map doesn't exist (is falsey), 'default' is called and its
return value is used as the map on which assoc is then called.
sourceraw docstring

assoc-in-defaultclj

(assoc-in-default m default [k & ks] v)

Just like the built-in 'assoc-in', except that a default type can be passed. If any of the nested levels do not exist, 'default' is called and its return value is used as the map which is then assoc'd.

Just like the built-in 'assoc-in', except that a default type can be passed.
If any of the nested levels do not exist, 'default' is called and its return
value is used as the map which is then assoc'd.
sourceraw docstring

nthclj

(nth coll index)
(nth coll index not-found)

Just like the built-in clojure.core/nth, except this also understands how to wrap negative indices.

For example:

(nth [1 2 3 4 5] 2)  => 3
(nth [1 2 3 4 5] -2) => 4
Just like the built-in clojure.core/nth, except this also understands
how to wrap negative indices.

For example:

    (nth [1 2 3 4 5] 2)  => 3
    (nth [1 2 3 4 5] -2) => 4
sourceraw docstring

second-to-lastclj

(second-to-last coll)

Return the second-to-last item in coll.

Return the second-to-last item in coll.
sourceraw docstring

update-in-defaultclj

(update-in-default m default [k & ks] f & args)

Just like the built-in 'update-in', except that a default type can be passed. If any of the nested levels do not exist, 'default' is called and its return value is used as the map which is then updated.

Just like the built-in 'update-in', except that a default type can be passed.
If any of the nested levels do not exist, 'default' is called and its return
value is used as the map which is then updated.
sourceraw docstring

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

× close