Liking cljdoc? Tell your friends :D

convex.clj.eval

Shortcuts for evaluating Convex Lisp code, useful for development and testing.

Takes a form (Clojure data expressing Convex Lisp code) and evaluates to some result returned as Clojure data.

This namespace offers many flavors of how exceptions and results are handled and returned.

Primarily useful for dev and testing.

Given context is always forked, meaning the argument is left intact. See [[convex.cvm/fork]].

Shortcuts for evaluating Convex Lisp code, useful for development and testing.

Takes a form (Clojure data expressing Convex Lisp code) and evaluates to some result returned as Clojure data.

This namespace offers many flavors of how exceptions and results are handled and returned.

Primarily useful for dev and testing.

Given context is always forked, meaning the argument is left intact. See [[convex.cvm/fork]].
raw docstring

*ctx-default*clj

Holder for a default context which can set whenever suited or dynamically with Clojure's binding.

Nil by default.

See alter-ctx-default.

Holder for a default context which can set whenever suited or dynamically with Clojure's `binding`.

Nil by default.

See [[alter-ctx-default]].
sourceraw docstring

alter-ctx-defaultclj

(alter-ctx-default ctx)

Sets the value of ctx-default.

Sets the value of *ctx-default*.
sourceraw docstring

codeclj

(code code form)
(code ctx code form)

Like exception but returns an exception only if it matches the given code.

See [[convex.cell/code-std*]].

Like [[exception]] but returns an exception only if it matches the given `code`.

See [[convex.cell/code-std*]].
sourceraw docstring

code*cljmacro

(code* code form)
(code* ctx code form)

Note: if code is a keyword, it is passed to [[convex.cell/code-std*]].

Note: if `code` is a keyword, it is passed to [[convex.cell/code-std*]].
sourceraw docstring

code?clj

(code? code form)
(code? ctx code form)

Like code but returns a boolean indicating if an exception of the given `code occured.

Like [[code]] but returns a boolean indicating if an exception of the given `code occured.
sourceraw docstring

code?*cljmacro

(code?* code form)
(code?* ctx code form)

Note: if code is a keyword, it is passed to [[convex.cell/code-std*]].

Note: if `code` is a keyword, it is passed to [[convex.cell/code-std*]].
sourceraw docstring

ctxclj

(ctx form)
(ctx ctx form)

Evaluates the given form and returns ctx.

Uses *ctx-default* if ctx is not provided.

Evaluates the given `form` and returns `ctx`.

Uses [[*ctx-default*]] if `ctx` is not provided.
sourceraw docstring

ctx*cljmacro

(ctx* form)
(ctx* ctx form)
source

exceptionclj

(exception form)
(exception ctx form)

Like ctx but returns the current exception or nil if there is none.

Like [[ctx]] but returns the current exception or nil if there is none.
sourceraw docstring

exception*cljmacro

(exception* form)
(exception* ctx form)
source

exception?clj

(exception? form)
(exception? ctx form)

Like ctx but returns a boolean indicating if an exception occured.

Like [[ctx]] but returns a boolean indicating if an exception occured.
sourceraw docstring

exception?*cljmacro

(exception?* form)
(exception?* ctx form)
source

like-clojure?clj

(like-clojure? form)
(like-clojure? ctx form)
(like-clojure? form f arg+)
(like-clojure? ctx form f arg+)

Returns true if applying arg+ to form on the CVM produces the exact same result as (apply f arg+)

Alternatively, a unique form can be given for both execution environments. In that case, the form is processed in Clojure via eval.

(like-clojure? '(+ 2 2))

(like-clojure? '+
               +
               [2 2)
Returns true if applying `arg+` to `form` on the CVM produces the exact same result as
`(apply f arg+)`

 Alternatively, a unique `form` can be given for both execution environments. In that case,
 the form is processed in Clojure via `eval`.

 ```clojure
 (like-clojure? '(+ 2 2))

 (like-clojure? '+
                +
                [2 2)
 ```
sourceraw docstring

like-clojure?*cljmacro

(like-clojure?* form)
(like-clojure?* ctx form)
(like-clojure?* form f arg+)
(like-clojure?* ctx form f arg+)
source

logclj

(log form)
(log ctx form)

Like ctx but returns the context log as Clojure data structure, where the last entry for the executing address is a map containing the given form as well as its return value.

Useful for debugging, akin to using println with Clojure.

Like [[ctx]] but returns the context log as Clojure data structure, where the last entry for the executing
address is a map containing the given `form` as well as its return value.

Useful for debugging, akin to using `println` with Clojure.
sourceraw docstring

log*cljmacro

(log* form)
(log* ctx form)
source

resultclj

(result form)
(result ctx form)

Like ctx but returns the result as Clojure data.

Like [[ctx]] but returns the result as Clojure data.
sourceraw docstring

result*cljmacro

(result* form)
(result* ctx form)
source

valueclj

(value form)
(value ctx form)

Like ctx but returns either an exception or a result.

Like [[ctx]] but returns either an [[exception]] or a [[result]].
sourceraw docstring

value*cljmacro

(value* form)
(value* ctx form)
source

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

× close