|
I kind of agree that something like "with" could be useful in Lua. In my opinion one way to do it would be to have a construct which forces garbage collection of the variables created when exiting the block. This way cleanup would be left to the `__gc` metamethod, but it would be deterministic. The advantage would be that it would also work with code that already uses the `__gc` metamethod as a cleanup possibility.