@@ -1805,11 +1805,13 @@ object* apply (object* function, object* args, object* env) {
18051805 }
18061806 if (consp (function) && isbuiltin (car (function), LAMBDA)) {
18071807 object* result = closure (false , sym (NIL), function, args, &env);
1808+ clrflag (TAILCALL);
18081809 return eval (result, env);
18091810 }
18101811 if (consp (function) && isbuiltin (car (function), CLOSURE)) {
18111812 function = cdr (function);
18121813 object* result = closure (false , sym (NIL), function, args, &env);
1814+ clrflag (TAILCALL);
18131815 return eval (result, env);
18141816 }
18151817 error (" illegal function" , function);
@@ -6045,7 +6047,8 @@ object* macroexpand1 (object* form, object* env, bool* done) {
60456047 }
60466048 while (symbolp (car (form))) form = cons (cdr (findvalue (car (form), env)), cdr (form));
60476049 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);
60496052 object* result = eval (form, env);
60506053 unprotect ();
60516054 return result;
@@ -7419,6 +7422,7 @@ object* eval (object* form, object* env) {
74197422
74207423 if (isbuiltin (car (function), LAMBDA)) {
74217424 form = closure (old_tailcall, name, function, args, &env);
7425+ clrflag (TAILCALL);
74227426 unprotect ();
74237427 int trace = tracing (fname->name );
74247428 if (trace) {
@@ -7439,6 +7443,7 @@ object* eval (object* form, object* env) {
74397443 function = cdr (function);
74407444 form = closure (old_tailcall, name, function, args, &env);
74417445 unprotect ();
7446+ clrflag (TAILCALL);
74427447 tailcall = true ;
74437448 goto EVAL;
74447449 }
0 commit comments