3 ms·
Lua 5.4 has to-be-closed variables that are similar in functions to with blocks in python. Unkike the __gc hook which provides no guarantee as to when it will
by pygy_ 5y ago
Lua 5.4 has to-be-closed variables that are similar in functions to with blocks in python.
Unkike the __gc hook which provides no guarantee as to when it will be called, if ever, the __close hook is called when a value goes out of scope.
http://www.lua.org/manual/5.4/manual.html#3.3.8 http://www.lua.org/manual/5.4/manual.html#3.3.8