|
x-engine-c v0.2.13
The C engine for x-lang
|
Syntax - Closure and Operative Creation (fn, op) More...
Functions | |
| static x_obj_t * | x_prim_closure (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_operative (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_syntax_closure_register (x_obj_t *p_base, x_obj_t *p_args) |
Syntax - Closure and Operative Creation (fn, op)
Closure creation form. x-lang: (fn params body ...)
Creates a procedure (closure) that captures the current environment and BST index (fexpr – params and body are not evaluated). The resulting closure does NOT have X_OBJ_FLAG_WRAP; only wrap applicatives do.
| p_base | Base (execution context). |
| p_args | Unevaluated argument list; expects (caller params body ...). |
Operative creation form. x-lang: (op formals env-param body ...)
Creates a user-level fexpr (operative) that receives unevaluated arguments and an explicit environment parameter (fexpr – formals, env-param, and body are not evaluated).
| p_base | Base (execution context). |
| p_args | Unevaluated argument list; expects (caller formals env-param body ...). |