core: Do macro expansion only once.

* mes.c (vm_eval_env): I will expand this macro only once.
This commit is contained in:
Jan Nieuwenhuizen 2016-12-22 08:31:20 +01:00
parent 326095c9c9
commit 681a541774

12
mes.c
View file

@ -467,7 +467,17 @@ vm_eval_env ()
#endif //QUASISYNTAX
default: {
SCM x = expand_macro_env (r1, r0);
if (x != r1) return eval_env (x, r0);
if (x != r1)
{
if (TYPE (x) == PAIR)
{
set_cdr_x (r1, cdr (x));
set_car_x (r1, car (x));
}
else
r1 = x;
return eval_env (x, r0);
}
SCM m = evlis_env (CDR (r1), r0);
return apply_env (car (r1), m, r0);
}