(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.
(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.
(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
(second-to-last coll)
Return the second-to-last item in coll.
Return the second-to-last item in coll.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close