lua-users home
lua-l archive

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


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