@@ -1805,11 +1805,13 @@ object* apply (object* function, object* args, object* env) {
1805
1805
}
1806
1806
if (consp (function) && isbuiltin (car (function), LAMBDA)) {
1807
1807
object* result = closure (false , sym (NIL), function, args, &env);
1808
+ clrflag (TAILCALL);
1808
1809
return eval (result, env);
1809
1810
}
1810
1811
if (consp (function) && isbuiltin (car (function), CLOSURE)) {
1811
1812
function = cdr (function);
1812
1813
object* result = closure (false , sym (NIL), function, args, &env);
1814
+ clrflag (TAILCALL);
1813
1815
return eval (result, env);
1814
1816
}
1815
1817
error (" illegal function" , function);
@@ -6045,7 +6047,8 @@ object* macroexpand1 (object* form, object* env, bool* done) {
6045
6047
}
6046
6048
while (symbolp (car (form))) form = cons (cdr (findvalue (car (form), env)), cdr (form));
6047
6049
protect (form);
6048
- form = closure (0 , sym (NIL), car (form), cdr (form), &env);
6050
+ form = closure (false , sym (NIL), car (form), cdr (form), &env);
6051
+ clrflag (TAILCALL);
6049
6052
object* result = eval (form, env);
6050
6053
unprotect ();
6051
6054
return result;
@@ -7419,6 +7422,7 @@ object* eval (object* form, object* env) {
7419
7422
7420
7423
if (isbuiltin (car (function), LAMBDA)) {
7421
7424
form = closure (old_tailcall, name, function, args, &env);
7425
+ clrflag (TAILCALL);
7422
7426
unprotect ();
7423
7427
int trace = tracing (fname->name );
7424
7428
if (trace) {
@@ -7439,6 +7443,7 @@ object* eval (object* form, object* env) {
7439
7443
function = cdr (function);
7440
7444
form = closure (old_tailcall, name, function, args, &env);
7441
7445
unprotect ();
7446
+ clrflag (TAILCALL);
7442
7447
tailcall = true ;
7443
7448
goto EVAL;
7444
7449
}
0 commit comments