Liking cljdoc? Tell your friends :D

serum.core


and-letcljmacro

(and-let bindings expr)
(and-let bindings expr else-expr)

Derived from Scheme's and-let, this macro will evaluate 'expr' should all of its bindings evaluate truthy. Evaluates 'else-expr' if any of the bindings evaluate falsey. Returns nil if 'else-expr' is not provided. Evaluation of bindings ceases upon a falsey result. 'bindings' expects a binding-forms vector as in (let) and (loop) etc. 'expr' expression to be evaluated if bindings evaluate truthy 'else-expr' expression to be evaluated if any bindings evaluate falsey

Derived from Scheme's and-let, this macro will evaluate 'expr' should all of its bindings evaluate truthy.
Evaluates 'else-expr' if any of the bindings evaluate falsey.  Returns nil if 'else-expr' is not provided.
Evaluation of bindings ceases upon a falsey result.
'bindings' expects a binding-forms vector as in (let) and (loop) etc.
'expr' expression to be evaluated if bindings evaluate truthy
'else-expr' expression to be evaluated if any bindings evaluate falsey
sourceraw docstring

and-let-corecljmacro

(and-let-core bindings expr)
source

and-let-else-corecljmacro

(and-let-else-core bindings expr else-expr)
source

attemptcljmacro

(attempt expr f)

the expression 'expr' will be executed in a try/catch form. if an exception is caught, a handler function of one argument, 'f', will be executed and will be passed the caught java exception object.

the expression 'expr' will be executed in a try/catch form.
if an exception is caught, a handler function of one argument, 'f', will be executed
and will be passed the caught java exception object.
sourceraw docstring

divertcljmacro

(divert & body)

derived from (with-out-str). Evaluates body, captures any output destined to out, and returns result of body and text output as a vector tuple, [~@body captured-output-string]

derived from (with-out-str).  Evaluates body, captures any output destined to *out*, and returns result
of body and text output as a vector tuple, [~@body captured-output-string]
sourceraw docstring

fail-letcljmacro

(fail-let binding expr)

conditional let form which expects binding expression to return a hashmap with {:success boolean} content. 'fail-let' supports a single binding pair: 'binding'. will evaluate 'expr' if (:success y#) is falsey. passes binding symbol/value to 'expr'.

conditional let form which expects binding expression to return a hashmap with {:success boolean} content.
'fail-let' supports a single binding pair: 'binding'.
will evaluate 'expr' if (:success y#) is falsey.
passes binding symbol/value to 'expr'.
sourceraw docstring

shiftclj

(shift f)
(shift f arg2)
(shift f arg2 arg3)
(shift f arg2 arg3 arg4 & args)

similar to partial, provides a modified interface to function 'f'. returns a function which accepts a single argument, always passing it as the first argument of 'f'. useful with (comp) and threading macros.

similar to partial, provides a modified interface to function 'f'.
returns a function which accepts a single argument, always passing it as the first argument of 'f'.
useful with (comp) and threading macros.
sourceraw docstring

success->cljmacro

(success-> x & forms)
source

success-letcljmacro

(success-let binding expr)
(success-let binding expr else-expr)

conditional let form which expects binding expression to return a hashmap with {:success boolean} content. 'success-let' supports a single binding pair: 'binding'. will evaluate 'expr' if (:success y#) is truthy. will evaluate 'else' if (:success y#) is falsey. passes binding symbol/value to both 'expr' and 'else-expr' expressions.

conditional let form which expects binding expression to return a hashmap with {:success boolean} content.
'success-let' supports a single binding pair: 'binding'.
will evaluate 'expr' if (:success y#) is truthy.
will evaluate 'else' if (:success y#) is falsey.
passes binding symbol/value to both 'expr' and 'else-expr' expressions.
sourceraw docstring

try-true?cljmacro

(try-true? expr)

the expression 'expr' is expected to be a validation form which returns booleanness. 'expr' will be executed in a try/catch form and a boolean returned. caught exceptions will return false.

the expression 'expr' is expected to be a validation form which returns booleanness.
'expr' will be executed in a try/catch form and a boolean returned.
caught exceptions will return false.
sourceraw docstring

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

× close