[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Manual §2.4 "(even if it is valid)"?
- From: nobody <nobody+lua-list@...>
- Date: Fri, 6 Oct 2017 04:02:21 +0200
On 2017-10-06 03:46, ? ? 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?
Valid for the operation (here: addition), as in "a number (or a string
coercible to a number)".
The intention is to express that Lua always looks for a metamethod on
the left operand first, failing that on the second (and failing that
throws an error), no matter the types of the values.