(?assoc m & kvs)
Same as assoc, but skip the assoc if v is nil
Same as assoc, but skip the assoc if v is nil
(check-and-throw a-spec db)
Throws an exception if db
doesn't match the Spec a-spec
.
Throws an exception if `db` doesn't match the Spec `a-spec`.
(doto-assert x f)
(doto-assert x f message)
Apply f to x and call clojure.core/assert
on the result. Return x.
Useful as an assertion method within -> threads
Apply f to x and call `clojure.core/assert` on the result. Return x. Useful as an assertion method within -> threads
(hierarchy keyseq xs)
Takes a sequence of keys and a sequence of maps. Returns a tree structure as a map where the first level keys are the distinct values mapped to the first element of keyseq and the values are maps containing elements of xs matching that key. The leaves are elements of xs.
Takes a sequence of keys and a sequence of maps. Returns a tree structure as a map where the first level keys are the distinct values mapped to the first element of keyseq and the values are maps containing elements of xs matching that key. The leaves are elements of xs.
(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.
(remove-nil-values m)
remove all keys with nil values in the map
remove all keys with nil values in the map
(rgb-to-hex r g b)
convert an r g b color from 8 bit mode to an hex string.
convert an r g b color from 8 bit mode to an hex string.
(split-and-reverse coll n)
Split a sequence at index n and reverse the front and back If n is negative split at index (count coll) + n and reverse front and back.
Split a sequence at index n and reverse the front and back If n is negative split at index (count coll) + n and reverse front and back.
(transform-map-keys f m)
Recursively transforms all map keys using f as a transformation function.
Recursively transforms all map keys using f as a transformation function.
(transform-map-vals f m)
takes a function of 2 arguments and a map and returns a tranformed map where the values are the result of applying f to the key and value.
takes a function of 2 arguments and a map and returns a tranformed map where the values are the result of applying f to the key and value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close