lua-users home
lua-l archive

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




On 2017-10-05 10:46 PM, ? ? wrote:
In Manual §2.4 in the description of __add metamethod:

If any operand for an addition is not a number (nor a string coercible to a number), Lua will try to call a metamethod. First, Lua will check the first operand (even if it is valid). ...

What does "(even if it is valid)" mean here?

Probably means it gets called even for things like debug.setmetatable(0, {__add=print})+{}?

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.