lua-users home
lua-l archive

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


List,

Now that I re-read the 5.4 reference on to-be-closed variables, *if*
the requirement to call the __close metamethod *exactly* when the
variable goes out of scope counts as the object being needed for
normal execution (though it's a bit of a stretch to call it accessible
from Lua outright, as __close might be a C function never calling back
into Lua), looks like to-be-closed variables *do* implement the
"create-local-and-forget"-style 'RAII' we're after. Maybe this needs
extra mention in the manual. Note that variable scope isn't mentioned
much in the manual (it's defined but not used too much, and I'm not
quite sure what a "non-void" statement is in Lua).

Best regards,

--
DoubleF