module invoke
Builtins for invoking Ops and FnDefs.
index
class op_invoke
-
op_invoke:setup(prev)
– Builtin:setup implementation. -
op_invoke:destroy()
– Builtin:destroy implementation. -
op_invoke:eval(scope, tail)
– perform an Op invocation. -
op_invoke.op
– The Op instance.
class fn_invoke
-
fn_invoke:eval(caller_scope, tail)
– evaluate a user-function invocation.
details
class op_invoke
- – Builtin:setup implementation.
- – Builtin:destroy implementation.
- – perform an Op invocation.
-
– The Op instance.
class fn_invoke
-
– evaluate a user-function invocation.
Creates a new Scope that inherits from
FnDef.scope
and hascaller_scope
as an additional parent for dynamic symbol resolution. Then AST:evals the tail incaller_scope
, and defines the results to the names inFnDef.params
in the newly created scope. Lastly, AST:clonesFnDef.body
with the prefix Builtin.tag, and AST:evals it in the newly created Scope.The Result contains the Stream from the cloned AST, and its children are all the Results from evaluating the tail as well as the cloned ASTs.
parameters:
- the active scope
- the arguments to this expression
returns:
- (Result): the result of this evaluation