x-engine-c v0.2.31
The C engine for x-lang
Loading...
Searching...
No Matches
x-eval-slots.h
Go to the documentation of this file.
1#ifndef X_EVAL_SLOTS_H
2#define X_EVAL_SLOTS_H
3
62/*
63 * ., .,
64 * {O,O}
65 * ( )
66 * " "
67 */
68
69#include "x-base.h"
70#include "x-vector.h"
71
148
159#define x_slot(V,I) x_vectorfn((V), (I))
160
169#define x_argrun(...) ((x_obj_t[]){ __VA_ARGS__ })
170
172#define x_eval_slots(B) x_restobj((B))
173
175#define x_eval_slot(B,I) x_slot(x_eval_slots((B)), (I))
176
182#define x_eval_slots_isset(B) \
183 ((B) != NULL && x_eval_slots((B)) != NULL)
184
190#define x_eval_call(B,I,A) (x_eval_slot((B), (I))((B), (A)))
191
198#define x_eval_call_or(B,I,FN,A) \
199 ((x_eval_slots_isset((B)) ? x_eval_slot((B), (I)) : (FN))((B), (A)))
200
205#define x_eval_slot_isset(B,I) \
206 (x_eval_slots_isset((B)) && x_eval_slot((B), (I)) != NULL)
207
209x_obj_t *x_slots_make(x_obj_t *p_base, x_int_t length);
210
213#endif /* X_EVAL_SLOTS_H */
Definition x-obj.h:214
Base environment object – the root context for evaluation.
x_obj_t * x_slots_make(x_obj_t *p_base, x_int_t length)
Definition x-vector.c:99
x_eval_slot_enum
Definition x-eval-slots.h:81
@ X_SLOT_CALLABLE_CALL
Definition x-eval-slots.h:101
@ X_SLOT_EVAL_OP_BODY
Definition x-eval-slots.h:98
@ X_SLOT_EVAL
Definition x-eval-slots.h:83
@ X_SLOT_TOKEN_READ
Definition x-eval-slots.h:124
@ X_SLOT_EVAL_BODY_TCO
Definition x-eval-slots.h:92
@ X_SLOT_HEAP_MARK
Definition x-eval-slots.h:135
@ X_SLOT_TOKEN_ANALYSE
Definition x-eval-slots.h:128
@ X_SLOT_HEAP_SWEEP
Definition x-eval-slots.h:139
@ X_SLOT_OBJ_PRIM_CALL
Definition x-eval-slots.h:107
@ X_SLOT_TOKEN_DELIMIT
Definition x-eval-slots.h:131
@ X_SLOT_ENV_LOOKUP
Definition x-eval-slots.h:110
@ X_SLOT_LEN
Definition x-eval-slots.h:146
@ X_SLOT_ENV_EXTEND
Definition x-eval-slots.h:118
@ X_SLOT_EVAL_TCO_TRAMPOLINE
Definition x-eval-slots.h:95
@ X_SLOT_EVAL_BODY
Definition x-eval-slots.h:89
@ X_SLOT_ALIST_BST_LOOKUP
Definition x-eval-slots.h:121
@ X_SLOT_OBJ_ALLOC
Definition x-eval-slots.h:143
@ X_SLOT_ENV_BIND
Definition x-eval-slots.h:114
@ X_SLOT_CALLABLE_APPLY
Definition x-eval-slots.h:104
@ X_SLOT_EVAL_LIST
Definition x-eval-slots.h:86
The vector layout – an object whose first data unit holds its length and whose other data units are i...
long x_int_t
Definition x.h:129