[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problem with 'lt' event in MAPM, Lua 4.0.
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 9 Oct 2002 22:24:43 -0300
>print(a,b, a==b) | 2.0 2.0 nil -- Error
>print(a,b, a~=b) | 2.0 2.0 1 -- Error
In Lua 4.0, there's no tag method for equality of userdata. Userdata compare
equal only if they are the same object. In your example, a and b are different
Lua objects, even though they represent the same Big number.
Lua 5.0 will have a metamethod for equality.
Also, thanks for Bcompare. I'll add it to the MAPM binding (and perhaps some
other functions) when I release it for Lua 5.0.