Liking cljdoc? Tell your friends :D

fooheads.stdlib


apply-ifclj/s

(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)`
raw docstring

binding-mapclj/s

(binding-map symbols)

cljs-env?clj/s

(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.
raw docstring

dissoc-valsclj/s

(dissoc-vals m pred)

Dissoc elements from m for which value matches pred

Dissoc elements from m for which value matches pred
raw docstring

dprnclj/smacro

(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
raw docstring

guardclj/smacro

(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.
raw docstring

map-keysclj/s

(map-keys f m)

Apply f to all keys in m

Apply f to all keys in m
raw docstring

map-valsclj/s

(map-vals f m)

Apply f to all values in m

Apply f to all values in m
raw docstring

qualified-nameclj/s

(qualified-name ident)

Returns a string with the qualified name of the ident

Returns a string with the qualified name of the ident
raw docstring

qualify-identclj/s

(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.
raw docstring

qualify-keysclj/s

(qualify-keys m nspace)

Qualify all the keys in a map

Qualify all the keys in a map
raw docstring

re->strclj/s


regex?clj/s

(regex? x)

Test whether x is a regular expression

Test whether x is a regular expression
raw docstring

render-templateclj/s

(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" 
raw docstring

simple-keywordclj/s

(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`
raw docstring

stable-intoclj/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.
raw docstring

substringclj/s

(substring s start end)

template-paramsclj/s

(template-params template)

Calculate a sequence of params required by the template

Calculate a sequence of params required by the template
raw docstring

throw-exclj/smacro

(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"}`
raw docstring

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

× close