Constructors for CVM cells and related type predicate functions.
Constructors for CVM cells and related type predicate functions.
Code execution in the CVM, altering state, and gaining insights.
Central entities of this namespaces are contextes and they can be created using ctx
.
All other functions revolve around them. While the design of a context is mostly immutable, whenever an altering function
is applied (eg. juice-set
) or code is handled in any way (eg. eval
), old context must be discarded and only returned
one should be used.
Cheap copies can be created using fork
.
Actions involving code (eg. compile
, exec
, ...) return a new context which holds either a result
or an exception
.
Those actions always consume juice
.
Given that a "cell" is the term reserved for CVM data and objects, execution consists of following steps:
Step | Function | Does |
---|---|---|
1 | expand | cell -> canonical cell , applies macros |
2 | compile | canonical cell -> op , preparing executable code |
3 | exec | Executes compiled code |
Any cell can be applied safely to those functions, worse that can happen is nothing (eg. providing an already compiled cell to
compile
).
If fine-grained control is not needed and if source is not compiled anyways, a simpler alternative is to use eval
which does
all the job.
Code execution in the CVM, altering state, and gaining insights. Central entities of this namespaces are contextes and they can be created using [[ctx]]. All other functions revolve around them. While the design of a context is mostly immutable, whenever an altering function is applied (eg. [[juice-set]]) or code is handled in any way (eg. [[eval]]), old context must be discarded and only returned one should be used. Cheap copies can be created using [[fork]]. Actions involving code (eg. [[compile]], [[exec]], ...) return a new context which holds either a [[result]] or an [[exception]]. Those actions always consume [[juice]]. Given that a "cell" is the term reserved for CVM data and objects, execution consists of following steps: | Step | Function | Does | |---|---|---| | 1 | [[expand]] | `cell` -> `canonical cell`, applies macros | | 2 | [[compile]] | `canonical cell` -> `op`, preparing executable code | | 3 | [[exec]] | Executes compiled code | Any cell can be applied safely to those functions, worse that can happen is nothing (eg. providing an already compiled cell to [[compile]]). If fine-grained control is not needed and if source is not compiled anyways, a simpler alternative is to use [[eval]] which does all the job.
Reading, parsing various kind of sources into CVX cells without any evaluation.
Attention, currently, functions that read only one cell fail when the input contains more than one. In the future, behavior should be improved. For instance, consuming cells one by one from a stream.
Also see the convex.write
namespace for the opposite idea.
Reading, parsing various kind of sources into CVX cells without any evaluation. Attention, currently, functions that read only one cell fail when the input contains more than one. In the future, behavior should be improved. For instance, consuming cells one by one from a stream. Also see the [[convex.write]] namespace for the opposite idea.
Writing, encoding CVX cells various kind of sources.
Binary is big-endian and text is UTF-8.
Also see convex.read
for the opposite idea.
Writing, encoding CVX cells various kind of sources. Binary is big-endian and text is UTF-8. Also see [[convex.read]] for the opposite idea.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close