|
Doesn't that make <const> redundant (and somewhat confusing)? Dropping <const> would then require setting the __close metamethod to nil to get the desired behavior, which would quickly get ugly - but isn't that also an issue for <toclose> variables? So letting my imagination run free, how about these for inspiration: local foo <const> = 3 local foo <{__close=myclosefoo}> = some_expression local foo <{__close=myclosefoo, __tostring=prettyprint}> = some_table In other words, call setmetatable from the declaration, which would convert the two separate statements needed now into one, which seems cleaner to me. |