lua-users home
lua-l archive

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


On Tue, Jul 2, 2019, 2:09 PM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
Why an error must be raised if a value doesn't have the metamethod?

I do wonder why not allow functions to be assigned and called when the local goes out of scope. It does make some kinds of error handling much simpler. It also is consistent with other metamethods like __index which may be another table or a function.