diff --git a/include/picrin/pair.h b/include/picrin/pair.h index dab97571..b6673a2a 100644 --- a/include/picrin/pair.h +++ b/include/picrin/pair.h @@ -39,6 +39,9 @@ pic_value pic_make_list(pic_state *, int, pic_value); pic_nil_p(tmp) ? false : ((var = pic_car(pic, tmp)), true); \ tmp = pic_cdr(pic, tmp)) +#define pic_push(pic, item, place) (place = pic_cons(pic, item, place)) +#define pic_pop(pic, place) (place = pic_cdr(pic, place)) + int pic_length(pic_state *, pic_value); pic_value pic_reverse(pic_state *, pic_value); pic_value pic_append(pic_state *, pic_value, pic_value); diff --git a/src/codegen.c b/src/codegen.c index a5d5ed8e..63ae63e3 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -400,8 +400,6 @@ analyze_quote(analyze_state *state, pic_value obj) return obj; } -#define pic_push(pic, item, place) (place = pic_cons(pic, item, place)) - static pic_value analyze_lambda(analyze_state *state, pic_value obj) {