From e7d38ea165472920dc1e7f8460331558408c9456 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 7 Feb 2014 01:31:45 +0900 Subject: [PATCH] rename scope_global_define -> global_def --- src/codegen.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/codegen.c b/src/codegen.c index 93bf5556..f4a85c36 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -1435,7 +1435,7 @@ pic_compile(pic_state *pic, pic_value obj) } static int -scope_global_define(pic_state *pic, pic_sym sym) +global_def(pic_state *pic, pic_sym sym) { xh_entry *e; @@ -1450,26 +1450,6 @@ scope_global_define(pic_state *pic, pic_sym sym) return e->val; } -void -pic_define(pic_state *pic, const char *name, pic_value val) -{ - int idx; - pic_sym sym, gsym; - - sym = pic_intern_cstr(pic, name); - gsym = pic_gensym(pic, sym); - - /* push to the global arena */ - idx = scope_global_define(pic, gsym); - pic->globals[idx] = val; - - /* register to the senv */ - xh_put_int(pic->lib->senv->tbl, sym, gsym); - - /* export! */ - pic_export(pic, pic_intern_cstr(pic, name)); -} - static int global_ref(pic_state *pic, const char *name) { @@ -1487,6 +1467,26 @@ global_ref(pic_state *pic, const char *name) return e->val; } +void +pic_define(pic_state *pic, const char *name, pic_value val) +{ + int idx; + pic_sym sym, gsym; + + sym = pic_intern_cstr(pic, name); + gsym = pic_gensym(pic, sym); + + /* push to the global arena */ + idx = global_def(pic, gsym); + pic->globals[idx] = val; + + /* register to the senv */ + xh_put_int(pic->lib->senv->tbl, sym, gsym); + + /* export! */ + pic_export(pic, pic_intern_cstr(pic, name)); +} + pic_value pic_ref(pic_state *pic, const char *name) {