diff --git a/include/picrin.h b/include/picrin.h index fea544d7..97108842 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -1,6 +1,8 @@ #ifndef PICRIN_H__ #define PICRIN_H__ +#include "picrin/value.h" + typedef struct { } pic_state; diff --git a/include/picrin/value.h b/include/picrin/value.h new file mode 100644 index 00000000..410f2b06 --- /dev/null +++ b/include/picrin/value.h @@ -0,0 +1,38 @@ +#ifndef VALUE_H__ +#define VALUE_H__ + +enum pic_vtype { + PIC_VTYPE_HEAP +}; + +typedef struct { + enum pic_vtype type; + union { + void *data; + } u; +} pic_value; + +enum pic_tt { + PIC_TT_PAIR, + PIC_TT_SYMBOL +}; + +#define PIC_OBJECT_HEADER \ + enum pic_tt tt; + +struct pic_object { + PIC_OBJECT_HEADER +}; + +struct pic_pair { + PIC_OBJECT_HEADER + pic_value car; + pic_value cdr; +}; + +struct pic_symbol { + PIC_OBJECT_HEADER + char *name; +}; + +#endif