Collection of useful Clojure utilities.
Collection of useful Clojure utilities.
(assoc* m & kvs)
Like clojure.core/assoc
, but won't assoc if key or val is nil.
Like `clojure.core/assoc`, but won't assoc if key or val is nil.
(contrast op)
(contrast op obj & objs)
Contrast multiple comparable objects with each other with op. (Wrapper
around clojure.core/compare
.) Example ops: < > <= >= = not=
Contrast multiple comparable objects with each other with op. (Wrapper around `clojure.core/compare`.) Example ops: < > <= >= = not=
(deep-merge & colls)
Like clojure.core/merge
, but recursively merges maps.
Like `clojure.core/merge`, but recursively merges maps.
(deep-merge-with _ coll)
(deep-merge-with f c1 c2)
(deep-merge-with f c1 c2 & cs)
Like clojure.core/merge-with
, but recursively merges maps.
Like `clojure.core/merge-with`, but recursively merges maps.
(derefable? ref)
Returns true if clojure.core/deref
can be called on ref.
Returns true if `clojure.core/deref` can be called on ref.
(dissoc-in m [k & ks])
Dissociates an entry from a nested associative structure returning a new nested structure. ks is a sequence of keys. Any empty maps that result will not be present in the new structure.
Dissociates an entry from a nested associative structure returning a new nested structure. ks is a sequence of keys. Any empty maps that result will not be present in the new structure.
(in? coll elm)
Returns true if coll contains elm.
Returns true if coll contains elm.
(macro-body-opts [opts & body :as params])
Helper for creating macros that accept an optional map of options in their body. Call this function in your macro on the rest-body param and it will return a vector containing the option map and the rest of the body.
An option map will be found if there were more than one form in the body and the first form is a map.
Helper for creating macros that accept an optional map of options in their body. Call this function in your macro on the rest-body param and it will return a vector containing the option map and the rest of the body. An option map will be found if there were more than one form in the body and the first form is a map.
(read-edn-resource path)
Read an EDN file at path from JVM resources.
Read an EDN file at path from JVM resources.
(regexp? x)
Returns true if x is a Java regular expression pattern.
Returns true if x is a Java regular expression pattern.
(submap? map1 map2)
Returns true if map1 is a subset of map2.
Returns true if map1 is a subset of map2.
(trim-end s substr)
Trim substr from the end of s.
Trim substr from the end of s.
(trim-start s substr)
Trim substr from the start of s.
Trim substr from the start of s.
(when-let* bindings & body)
Short circuiting version of clojure.core/when-let
on multiple binding
forms.
Short circuiting version of `clojure.core/when-let` on multiple binding forms.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close