(apply-if pred f & args)
Returns a function that applies f if pred returns true for the specified value.
Usually used in combination with clojure.walk/postwalk
, e.g.
(postwalk (apply-if keyword? str) coll)
Returns a function that applies f if pred returns true for the specified value. Usually used in combination with `clojure.walk/postwalk`, e.g. `(postwalk (apply-if keyword? str) coll)`
(binding-map symbols)
(cljs-env? env)
Take the &env from a macro, and tell whether we are expanding into cljs.
Take the &env from a macro, and tell whether we are expanding into cljs.
(dissoc-vals m pred)
Dissoc elements from m for which value matches pred
Dissoc elements from m for which value matches pred
(dprn msg-template & symbols)
Renders the template using the scoped vars, println's the msg and pprint's the arg-map
Renders the template using the scoped vars, println's the msg and pprint's the arg-map
(guard pred v msg)
(guard pred v msg data-map)
A guard that throws an exception (with msg) if v does not meet pred.
A guard that throws an exception (with msg) if v does not meet pred.
(qualified-name ident)
Returns a string with the qualified name of the ident
Returns a string with the qualified name of the ident
(qualify-ident nspace nameable)
Qualifies an ident. nspace and nameable must of same
type. The nspace must be a simple-ident?
and nameable
can be either simple-ident?
or qualified-ident?
.
If nameable is already qualified, it will change namespace.
Qualifies an ident. nspace and nameable must of same type. The nspace must be a `simple-ident?` and nameable can be either `simple-ident?` or `qualified-ident?`. If nameable is already qualified, it will change namespace.
(qualify-keys m nspace)
Qualify all the keys in a map
Qualify all the keys in a map
(regex? x)
Test whether x is a regular expression
Test whether x is a regular expression
(render-template template args)
Renders the template using args for data. Example:
(render-template "Error: {error-code}" {:error-code 11})
; => "Error: 11"
Renders the template using args for data. Example: `(render-template "Error: {error-code}" {:error-code 11})` ; => "Error: 11"
(simple-keyword s)
Forces a simple keyword. Useful when forward slashes can
be present in the string s
Forces a simple keyword. Useful when forward slashes can be present in the string `s`
(stable-into)
(stable-into to)
(stable-into to from)
Like clojure.core/into, but keeps the original order for lists. Does not support transducers.
Like clojure.core/into, but keeps the original order for lists. Does not support transducers.
(substring s start end)
(template-params template)
Calculate a sequence of params required by the template
Calculate a sequence of params required by the template
(throw-ex msg-template & symbols)
Throw an exception with a msg template and optional vars. The msg template will be rendered using the scoped vars and the template args and vars will be put in the map to ex-info.
Example:
`(let [namn "foohead" age 8] (throw-ex "Hello {namn}" age))
; => {:age 8, :namn "foohead", :msg "Hello foohead"}`
Throw an exception with a msg template and optional vars. The msg template will be rendered using the scoped vars and the template args and vars will be put in the map to ex-info. Example: `(let [namn "foohead" age 8] (throw-ex "Hello {namn}" age)) ; => {:age 8, :namn "foohead", :msg "Hello foohead"}`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close