A lot of work
This commit is contained in:
@ -91,12 +91,19 @@ static ALWAYS_INLINE LispVal *LIST_N(int count, ...) {
|
||||
}
|
||||
#define LIST(...) MACRO_CALLN(LIST, __VA_ARGS__)
|
||||
|
||||
#define FIRST(x) XCAR(x)
|
||||
#define SECOND(x) XCAR(XCDR(x))
|
||||
#define THIRD(x) XCAR(XCDR(XCDR(x)))
|
||||
#define FOURTH(x) XCAR(XCDR(XCDR(XCDR(x))))
|
||||
#define FIFTH(x) XCAR(XCDR(XCDR(XCDR(XCDR(x)))))
|
||||
|
||||
#define FOREACH(l, v) \
|
||||
for (LispVal *_tail = (l), *v = XCAR(_tail); !NILP(_tail); \
|
||||
_tail = XCDR(_tail), v = XCAR(_tail))
|
||||
|
||||
#define FOREACH_TAIL(l, v) for (LispVal *v = (l); !NILP(v); v = XCDR_SAFE(v))
|
||||
|
||||
// return -1 list is circular
|
||||
intptr_t list_length(LispVal *list);
|
||||
// Return true if the length of LIST == SIZE
|
||||
bool list_length_eq(LispVal *list, intptr_t size);
|
||||
|
||||
Reference in New Issue
Block a user