support varg lambda

This commit is contained in:
Yuichi Nishiwaki 2013-11-26 16:51:17 -08:00
parent b2704fb123
commit 3710d5feea
1 changed files with 3 additions and 1 deletions

View File

@ -131,12 +131,14 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
in->tbl = xh_new();
in->stx = NULL;
for (a = pic_cadr(pic, expr); ! pic_nil_p(a); a = pic_cdr(pic, a)) {
for (a = pic_cadr(pic, expr); pic_pair_p(a); a = pic_cdr(pic, a)) {
pic_sym gen, orig;
orig = pic_sym(pic_car(pic, a));
gen = new_uniq_sym(pic, orig);
xh_put(senv->tbl, pic_symbol_name(pic, orig), (int)gen);
if (pic_symbol_p(a)) {
xh_put(senv->tbl, pic_symbol_name(pic, pic_sym(a)), (int)new_uniq_sym(pic, pic_sym(a)));
}
v = pic_cons(pic, pic_symbol_value(pic_syntax(car)->sym),