Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef TCO_H_
- #define TCO_H_
- #include "stdarg.h"
- void (*nextfun)(void *);
- void *nextarg;
- #define CALL(fun, arg) \
- do { \
- nextfun = fun; \
- nextarg = arg; \
- while(nextfun) \
- nextfun(nextarg); \
- } while(0);
- #define CALL2(fun, arg) \
- do { \
- nextfun = fun; \
- nextarg = arg; \
- return; \
- } while(0);
- #define RETURN CALL2(NULL, NULL)
- typedef struct conscell_str {
- void *car;
- void *cdr;
- } *conscell;
- #define cons(x, y) cons_f((void *)x, (void *)y)
- conscell cons_f(void *car, void *cdr);
- #define car(x) ((conscell)x)->car
- #define cdr(x) ((conscell)x)->cdr
- #define integer(x) (uint64_t)(x)
- /*conscell list(...); */
- #endif
Add Comment
Please, Sign In to add comment