lua-users home
lua-l archive

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


Mark Hamburg wrote:
> * Comparison operators do not insist on metamethod equality.

Yes, I'd like to have that, too.

[I'll need something like this for the FFI cdata, anyway. Otherwise
boxed 64 bit integers cannot be compared to plain numbers. There
are no backwards compatibility issues with FFI cdata of course.]

But changing the semantics for all types is definitely a breaking
change. So it would need to be off by default and could be enabled
with a -DLUAJIT_ENABLE_COMPAT52 switch. But I'll hold back on
adding these kind of changes for now.

BTW: Actually only the ordered comparison operators <, >, <=, >=
have been changed in Lua 5.2. Equality == and inequality ~= still
consider different types unconditionally as different and won't
check metamethods. No luck comparing userdata to numbers or such.

--Mike