class Builtin
Builtin / Special Form evaluation Strategy (builtin).
Responsible for quoting/evaluating subexpressions, instantiating and setting up Ops, updating the current Scope, etc. See builtin and invoke for examples.
index
builtin interface
-
builtin(cell, head)
– create a new instance. -
builtin:eval(scope, tail)
– perform the actual evaluation. -
builtin:destroy()
– free resources -
builtin:setup(prev)
– setup or copy state from previous instance of same type. -
builtin.cell
– the Cell this Builtin was created for. -
builtin.head
– the evaluated head of cell. -
builtin.tag
– the identity of cell.
static functions
-
Builtin:eval_cell(cell, scope, head)
– create and setup a Builtin for a given tag, then evaluate it.
details
builtin interface
- – create a new instance.
-
– perform the actual evaluation.
Implementations should:
- eval or quote
tail
values - perform scope effects
- wrap all child-results
parameters:
- the active scope
- the arguments to this expression
returns:
- (Result): the result of this evaluation
- eval or quote
-
– free resources
-
– setup or copy state from previous instance of same type.
prev
is only passed if Builtin types of prev and current expression match. Otherwise, or when no previous expression exists,nil
is passed.parameters:
- the previous Builtin instance
-
– the Cell this Builtin was created for.
-
– the evaluated head of cell.
-
– the identity of cell.
static functions
- – create and setup a Builtin for a given tag, then evaluate it.