lua-users home
lua-l archive

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


>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.
--lhf