add pair?
This commit is contained in:
parent
c88f0926a4
commit
c782912212
11
src/pair.c
11
src/pair.c
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue