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
from :project/cvm
.
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` from `:project/cvm`.
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]].
(alter-ctx-default ctx)
Sets the value of ctx-default.
Sets the value of *ctx-default*.
(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*
from :project/cvm
.
Like [[exception]] but returns an exception only if it matches the given `code`. See `convex.cell/code-std*` from `:project/cvm`.
(code* code form)
(code* ctx code form)
Note: if code
is a keyword, it is passed to convex.cell/code-std*
from :project/cvm
.
Note: if `code` is a keyword, it is passed to `convex.cell/code-std*` from `:project/cvm`.
(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.
(code?* code form)
(code?* ctx code form)
Note: if code
is a keyword, it is passed to convex.cell/code-std*
from :project/cvm
.
Note: if `code` is a keyword, it is passed to `convex.cell/code-std*` from `:project/cvm`.
(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.
(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.
(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.
(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) ```
(like-clojure?* form)
(like-clojure?* ctx form)
(like-clojure?* form f arg+)
(like-clojure?* ctx form f arg+)
(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.
(result form)
(result ctx form)
Like ctx
but returns the result as Clojure data.
Like [[ctx]] but returns the result as Clojure data.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close