diff --git a/include/picrin/pair.h b/include/picrin/pair.h index b6673a2a..64d5d1cb 100644 --- a/include/picrin/pair.h +++ b/include/picrin/pair.h @@ -29,6 +29,7 @@ pic_value pic_list3(pic_state *, pic_value, pic_value, pic_value); pic_value pic_list4(pic_state *, pic_value, pic_value, pic_value, pic_value); pic_value pic_list5(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value); pic_value pic_list6(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value); +pic_value pic_list7(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value); pic_value pic_list_by_array(pic_state *, size_t, pic_value *); pic_value pic_make_list(pic_state *, int, pic_value); diff --git a/src/pair.c b/src/pair.c index ecfc03a7..37d5ff7f 100644 --- a/src/pair.c +++ b/src/pair.c @@ -146,6 +146,19 @@ pic_list6(pic_state *pic, pic_value obj1, pic_value obj2, pic_value obj3, pic_va return val; } +pic_value +pic_list7(pic_state *pic, pic_value obj1, pic_value obj2, pic_value obj3, pic_value obj4, pic_value obj5, pic_value obj6, pic_value obj7) +{ + int ai = pic_gc_arena_preserve(pic); + pic_value val; + + val = pic_cons(pic, obj1, pic_list6(pic, obj2, obj3, obj4, obj5, obj6, obj7)); + + pic_gc_arena_restore(pic, ai); + pic_gc_protect(pic, val); + return val; +} + pic_value pic_list_by_array(pic_state *pic, size_t c, pic_value *vs) {