diff --git a/include/picrin/proc.h b/include/picrin/proc.h index 89d06163..bc9b0db2 100644 --- a/include/picrin/proc.h +++ b/include/picrin/proc.h @@ -30,7 +30,7 @@ struct pic_proc *pic_proc_new(pic_state *, pic_func_t); struct pic_proc *pic_proc_new_irep(pic_state *, struct pic_irep *, struct pic_env *); /* closed variables accessor */ -void pic_proc_cv_reserve(pic_state *, struct pic_proc *, size_t); +void pic_proc_cv_init(pic_state *, struct pic_proc *, size_t); int pic_proc_cv_size(pic_state *, struct pic_proc *); pic_value pic_proc_cv_ref(pic_state *, struct pic_proc *, size_t); void pic_proc_cv_set(pic_state *, struct pic_proc *, size_t, pic_value); diff --git a/src/cont.c b/src/cont.c index ec5d311c..7c1aa111 100644 --- a/src/cont.c +++ b/src/cont.c @@ -164,7 +164,7 @@ pic_cont_callcc(pic_state *pic) c = pic_proc_new(pic, cont_call); /* save the continuation object in proc */ - pic_proc_cv_reserve(pic, c, 1); + pic_proc_cv_init(pic, c, 1); pic_proc_cv_set(pic, c, 0, pic_obj_value(cont)); return pic_apply_argv(pic, cb, 1, pic_obj_value(c)); diff --git a/src/macro.c b/src/macro.c index fdd2b7b4..0f8b97da 100644 --- a/src/macro.c +++ b/src/macro.c @@ -732,12 +732,12 @@ er_macro_call(pic_state *pic) } rename = pic_proc_new(pic, er_macro_rename); - pic_proc_cv_reserve(pic, rename, 2); + pic_proc_cv_init(pic, rename, 2); pic_proc_cv_set(pic, rename, 0, use_env); pic_proc_cv_set(pic, rename, 1, mac_env); compare = pic_proc_new(pic, er_macro_compare); - pic_proc_cv_reserve(pic, compare, 2); + pic_proc_cv_init(pic, compare, 2); pic_proc_cv_set(pic, compare, 0, use_env); pic_proc_cv_set(pic, compare, 1, mac_env); @@ -754,7 +754,7 @@ pic_macro_er_macro_transformer(pic_state *pic) pic_get_args(pic, "l", &cb); proc = pic_proc_new(pic, er_macro_call); - pic_proc_cv_reserve(pic, proc, 1); + pic_proc_cv_init(pic, proc, 1); pic_proc_cv_set(pic, proc, 0, pic_obj_value(cb)); return pic_obj_value(proc); diff --git a/src/proc.c b/src/proc.c index 6f772de8..f40cf0d8 100644 --- a/src/proc.c +++ b/src/proc.c @@ -28,7 +28,7 @@ pic_proc_new_irep(pic_state *pic, struct pic_irep *irep, struct pic_env *env) } void -pic_proc_cv_reserve(pic_state *pic, struct pic_proc *proc, size_t cv_size) +pic_proc_cv_init(pic_state *pic, struct pic_proc *proc, size_t cv_size) { struct pic_env *env; diff --git a/src/var.c b/src/var.c index e2cf9832..80e61f76 100644 --- a/src/var.c +++ b/src/var.c @@ -78,7 +78,7 @@ pic_var_make_parameter(pic_state *pic) var = pic_var_new(pic, init, conv); proc = pic_proc_new(pic, var_call); - pic_proc_cv_reserve(pic, proc, 1); + pic_proc_cv_init(pic, proc, 1); pic_proc_cv_set(pic, proc, 0, pic_obj_value(var)); return pic_obj_value(proc);