lua-users home
lua-l archive

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


On Tue, Jul 24, 2018 at 5:43 PM, John Belmonte <john@neggie.net> wrote:
> Sorry didn't realize that was psuedocode.  Yes, same thing I proposed in
> another thread.  But exit func must be a new 4th parameter else you'll break
> a lot of existing code.

I don't really see why? IIRC, the proposal was that the __exit
metamethod is called only if it exists. So if you want your "state"
object to be released if the loop breaks, add an __exit metamethod to
new code. Fortunately, it doesn't break anything in old versions of
Lua; it maintains the status quo.

-- 
Patrick Donnelly