add pair?

This commit is contained in:
Yuichi Nishiwaki 2013-10-25 00:37:08 +09:00
parent c88f0926a4
commit c782912212
1 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,16 @@ pic_acons(pic_state *pic, pic_value key, pic_value val, pic_value assoc)
return pic_cons(pic, pic_cons(pic, key, val), assoc); return pic_cons(pic, pic_cons(pic, key, val), assoc);
} }
static pic_value
pic_pair_pair_p(pic_state *pic)
{
pic_value v;
pic_get_args(pic, "o", &v);
return pic_bool_value(pic_pair_p(v));
}
static pic_value static pic_value
pic_pair_set_car(pic_state *pic) pic_pair_set_car(pic_state *pic)
{ {
@ -146,6 +156,7 @@ pic_pair_set_cdr(pic_state *pic)
void void
pic_init_pair(pic_state *pic) pic_init_pair(pic_state *pic)
{ {
pic_defun(pic, "pair?", pic_pair_pair_p);
pic_defun(pic, "set-car!", pic_pair_set_car); pic_defun(pic, "set-car!", pic_pair_set_car);
pic_defun(pic, "set-cdr!", pic_pair_set_cdr); pic_defun(pic, "set-cdr!", pic_pair_set_cdr);
} }