save some special symbols in pic_state structure

This commit is contained in:
Yuichi Nishiwaki 2013-10-14 18:28:52 +09:00
parent 8c73ded2c4
commit 42dbd5fe98
3 changed files with 7 additions and 3 deletions

View File

@ -18,6 +18,7 @@ typedef struct {
pic_value *sp; pic_value *sp;
pic_value *stbase, *stend; pic_value *stbase, *stend;
pic_value sDEFINE, sCONS, sADD;
struct pic_env *global_env; struct pic_env *global_env;
struct heap_page *heap; struct heap_page *heap;

View File

@ -35,6 +35,9 @@ pic_open()
pic->arena_idx = 0; pic->arena_idx = 0;
pic->global_env = pic_new_empty_env(); 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; return pic;
} }

View File

@ -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; pic_value sDEFINE, sCONS, sADD;
sDEFINE = pic_intern_cstr(pic, "define"); sDEFINE = pic->sDEFINE;
sCONS = pic_intern_cstr(pic, "cons"); sCONS = pic->sCONS;
sADD = pic_intern_cstr(pic, "add"); sADD = pic->sADD;
switch (pic_type(obj)) { switch (pic_type(obj)) {
case PIC_TT_SYMBOL: { case PIC_TT_SYMBOL: {