save some special symbols in pic_state structure
This commit is contained in:
parent
8c73ded2c4
commit
42dbd5fe98
|
@ -18,6 +18,7 @@ typedef struct {
|
|||
pic_value *sp;
|
||||
pic_value *stbase, *stend;
|
||||
|
||||
pic_value sDEFINE, sCONS, sADD;
|
||||
struct pic_env *global_env;
|
||||
|
||||
struct heap_page *heap;
|
||||
|
|
|
@ -35,6 +35,9 @@ pic_open()
|
|||
pic->arena_idx = 0;
|
||||
|
||||
pic->global_env = pic_new_empty_env();
|
||||
pic->sDEFINE = pic_intern_cstr(pic, "define");
|
||||
pic->sCONS = pic_intern_cstr(pic, "cons");
|
||||
pic->sADD = pic_intern_cstr(pic, "add");
|
||||
|
||||
return pic;
|
||||
}
|
||||
|
|
6
src/vm.c
6
src/vm.c
|
@ -57,9 +57,9 @@ pic_gen(pic_state *pic, struct pic_irep *irep, pic_value obj, struct pic_env *en
|
|||
{
|
||||
pic_value sDEFINE, sCONS, sADD;
|
||||
|
||||
sDEFINE = pic_intern_cstr(pic, "define");
|
||||
sCONS = pic_intern_cstr(pic, "cons");
|
||||
sADD = pic_intern_cstr(pic, "add");
|
||||
sDEFINE = pic->sDEFINE;
|
||||
sCONS = pic->sCONS;
|
||||
sADD = pic->sADD;
|
||||
|
||||
switch (pic_type(obj)) {
|
||||
case PIC_TT_SYMBOL: {
|
||||
|
|
Loading…
Reference in New Issue