error on macroexpanding circular objects

This commit is contained in:
Yuichi Nishiwaki 2014-04-01 11:40:36 +09:00
parent e32e42c5f9
commit b5a307aa88
1 changed files with 4 additions and 0 deletions

View File

@ -262,6 +262,10 @@ macroexpand_node(pic_state *pic, pic_value expr, struct pic_senv *senv, pic_valu
pic_value car, v;
xh_entry *e;
if (! pic_list_p(expr)) {
pic_errorf(pic, "cannot macroexpand improper list: ~s", expr);
}
car = macroexpand(pic, pic_car(pic, expr), senv, assoc_box);
if (pic_sym_p(car)) {
pic_sym tag = pic_sym(car);