This commit is contained in:
Yuichi Nishiwaki 2017-05-07 02:41:21 +09:00
parent 166382d5c3
commit da27d2ff75
5 changed files with 6 additions and 18 deletions

View File

@ -547,8 +547,8 @@ read_label_set(pic_state *pic, pic_value port, int i, struct reader_control *p)
kh_val(h, it) = val = pic_cons(pic, pic_undef_value(pic), pic_undef_value(pic));
tmp = read_core(pic, port, c, p);
pair_ptr(pic, val)->car = pic_car(pic, tmp);
pair_ptr(pic, val)->cdr = pic_cdr(pic, tmp);
pic_set_car(pic, val, pic_car(pic, tmp));
pic_set_cdr(pic, val, pic_cdr(pic, tmp));
return val;
}

View File

@ -219,7 +219,6 @@ struct object *pic_obj_alloc_unsafe(pic_state *, int type);
struct frame *pic_make_frame_unsafe(pic_state *, int n);
pic_value pic_make_proc_irep_unsafe(pic_state *, struct irep *, struct frame *);
pic_value pic_make_proc_func(pic_state *, pic_func_t);
pic_value pic_make_record(pic_state *, pic_value type, pic_value datum);
pic_value pic_record_type(pic_state *pic, pic_value record);
pic_value pic_record_datum(pic_state *pic, pic_value record);

View File

@ -92,7 +92,7 @@ pic_list_p(pic_state *pic, pic_value obj)
/* advance rapid fast-forward; runs 2x faster than local */
for (i = 0; i < 2; ++i) {
if (pic_pair_p(pic, rapid)) {
rapid = pair_ptr(pic, rapid)->cdr;
rapid = pic_cdr(pic, rapid);
}
else {
return pic_nil_p(pic, rapid);
@ -100,7 +100,7 @@ pic_list_p(pic_state *pic, pic_value obj)
}
/* advance local */
local = pair_ptr(pic, local)->cdr;
local = pic_cdr(pic, local);
if (pic_eq_p(pic, local, rapid)) {
return false;
@ -154,7 +154,7 @@ pic_list_ref(pic_state *pic, pic_value list, int i)
void
pic_list_set(pic_state *pic, pic_value list, int i, pic_value obj)
{
pair_ptr(pic, pic_list_tail(pic, list, i))->car = obj;
pic_set_car(pic, pic_list_tail(pic, list, i), obj);
}
pic_value

View File

@ -207,17 +207,6 @@ pic_vlambda(pic_state *pic, pic_func_t f, int n, va_list ap)
return obj_value(pic, proc);
}
pic_value
pic_make_proc_func(pic_state *pic, pic_func_t func)
{
struct proc *proc;
proc = (struct proc *)pic_obj_alloc(pic, PIC_TYPE_PROC_FUNC);
proc->u.func = func;
proc->env = NULL;
return obj_value(pic, proc);
}
pic_value
pic_make_proc_irep_unsafe(pic_state *pic, struct irep *irep, struct frame *fp)
{

View File

@ -360,7 +360,7 @@ pic_define(pic_state *pic, const char *name, pic_value val)
void
pic_defun(pic_state *pic, const char *name, pic_func_t f)
{
pic_define(pic, name, pic_make_proc_func(pic, f));
pic_define(pic, name, pic_lambda(pic, f, 0));
}
void