let pic_proc be a first class object

This commit is contained in:
Yuichi Nishiwaki
2013-10-13 16:16:13 +09:00
parent d92bd71293
commit 1fb9ac5d03
3 changed files with 11 additions and 8 deletions
-6
View File
@@ -11,12 +11,6 @@ struct pic_env {
struct pic_env *parent;
};
struct pic_proc {
union {
struct pic_irep *irep;
} u;
};
#define PIC_HEAP_SIZE 1024
typedef struct {
+10 -1
View File
@@ -23,7 +23,8 @@ enum pic_tt {
PIC_TT_UNDEF,
/* heap */
PIC_TT_PAIR,
PIC_TT_SYMBOL
PIC_TT_SYMBOL,
PIC_TT_PROC
};
#define PIC_OBJECT_HEADER \
@@ -44,8 +45,16 @@ struct pic_symbol {
char *name;
};
struct pic_proc {
PIC_OBJECT_HEADER
union {
struct pic_irep *irep;
} u;
};
#define pic_pair_ptr(o) ((struct pic_pair *)o.u.data)
#define pic_symbol_ptr(o) ((struct pic_symbol *)o.u.data)
#define pic_proc_ptr(o) ((struct pic_proc *)o.u.data)
enum pic_tt pic_type(pic_value);