diff --git a/src/pair.c b/src/pair.c index 072cb97e..2f522891 100644 --- a/src/pair.c +++ b/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); } +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 pic_pair_set_car(pic_state *pic) { @@ -146,6 +156,7 @@ pic_pair_set_cdr(pic_state *pic) void 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-cdr!", pic_pair_set_cdr); }