[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Comparing numerical objects for equality (patch)
- From: Tomás Guisasola <tomasguisasola@...>
- Date: Thu, 9 Jun 2022 07:46:12 -0300
Hi Eduardo and Andrew
>> But there's a problem when comparing for equality, because the __eq
>> metamethod is only called when _both_ operands are tables or userdata!
>>
>> if a == 1 then -- metamethod __eq
>> print "true"
>> else
>> print "false"
>> end
>> [ false ]
What I didn't understand is why you have to represent the number 1 as
a table. In other words, why don't you make the result of `mpi(1)` be
the number 1 ?
Regards,
Tomás