diff --git a/include/picrin.h b/include/picrin.h index 626a52a4..3435ee77 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -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; diff --git a/src/state.c b/src/state.c index 5d96b76a..80588d95 100644 --- a/src/state.c +++ b/src/state.c @@ -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; } diff --git a/src/vm.c b/src/vm.c index 851f02f1..255f3efc 100644 --- a/src/vm.c +++ b/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: {