add pic_list_p
This commit is contained in:
parent
15c4361381
commit
db1f977600
|
@ -5,6 +5,7 @@ pic_value pic_cons(pic_state *, pic_value, pic_value);
|
|||
pic_value pic_car(pic_state *, pic_value);
|
||||
pic_value pic_cdr(pic_state *, pic_value);
|
||||
|
||||
bool pic_list_p(pic_state *, pic_value);
|
||||
pic_value pic_list(pic_state *, size_t, ...);
|
||||
|
||||
pic_value pic_assq(pic_state *, pic_value key, pic_value assoc);
|
||||
|
|
|
@ -39,6 +39,15 @@ pic_cdr(pic_state *pic, pic_value obj)
|
|||
return pair->cdr;
|
||||
}
|
||||
|
||||
bool
|
||||
pic_list_p(pic_state *pic, pic_value obj)
|
||||
{
|
||||
while (pic_pair_p(obj))
|
||||
obj = pic_pair_ptr(obj)->cdr;
|
||||
|
||||
return pic_nil_p(obj);
|
||||
}
|
||||
|
||||
pic_value
|
||||
pic_assq(pic_state *pic, pic_value key, pic_value assoc)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue