lua-users home
lua-l archive

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




On Jul 18, 2018, at 8:55 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

A good use I see for "local scoped" is in C functions, which often have
a hard time to properly free resources. With something like "local scoped",
it would be enough one single function to mark a stack position as
a scoped variable, to be finalized when the function exits.

+1 to this. Handling resource management in C is pretty cumbersome if the function calls any Lua function that might throw an exception (which is most).

—Tim