add eq? function
This commit is contained in:
parent
b10ef13ca0
commit
207ec5bd24
16
src/bool.c
16
src/bool.c
|
@ -17,3 +17,19 @@ pic_eq_p(pic_state *pic, pic_value x, pic_value y)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static pic_value
|
||||
pic_bool_eq_p(pic_state *pic)
|
||||
{
|
||||
pic_value x, y;
|
||||
|
||||
pic_get_args(pic, "oo", &x, &y);
|
||||
|
||||
return pic_bool_value(pic_eq_p(pic, x, y));
|
||||
}
|
||||
|
||||
void
|
||||
pic_init_bool(pic_state *pic)
|
||||
{
|
||||
pic_defun(pic, "eq?", pic_bool_eq_p);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "picrin.h"
|
||||
#include "picrin/pair.h"
|
||||
|
||||
void pic_init_bool(pic_state *);
|
||||
void pic_init_pair(pic_state *);
|
||||
void pic_init_port(pic_state *);
|
||||
void pic_init_number(pic_state *);
|
||||
|
@ -65,6 +66,7 @@ pic_init_core(pic_state *pic)
|
|||
int ai;
|
||||
|
||||
ai = pic_gc_arena_preserve(pic);
|
||||
pic_init_bool(pic); DONE;
|
||||
pic_init_pair(pic); DONE;
|
||||
pic_init_port(pic); DONE;
|
||||
pic_init_number(pic); DONE;
|
||||
|
|
Loading…
Reference in New Issue