lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Sat, Aug 26, 2023 at 7:47 AM Jan Behrens <jbe-mlist@magnetkern.de> wrote:

I think this is because of the introduction of to-be-closed variables
in Lua 5.4 and the fourth argument to generic for-loops. Note, however,
that the example program does not use to-be-closed variables. Yet, the
generic for-loop prohibits the recursive call to be executed as a tail
call.


It'll be tricky to fix this because it is not known until runtime whether a function like 'pairs' returns a to-be-closed variable.
Closing the to-be-closed variable before the return may make the loop variables inaccessible, introducing another problem.

--