lua-users home
lua-l archive

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




On Sat, Jun 1, 2019 at 15:21 Coda Highland <chighland@gmail.com> wrote:


On Sat, Jun 1, 2019 at 2:13 PM Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:

The solution is to assert that <toclose> variables are always considered live. It is, after all, an explicit declaration that the end of the variable's lifetime is precisely the same as the end of the lexical scope. And this would also be one of the more common reasons to use a <toclose> variable in the first place, so it's a win-win.

/s/ Adam

One thing I wonder: does the use of ‘toclose’ disable tail calls, or are the calls to ‘__close’ metamethods executed before the tail call? It should be the first case, but I think a warning would be useful.

--
-- Gė