lua-users home
lua-l archive

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

I think the following two statement should be equal
1.    v>= 1 and v <= 1
2.    v== 1
Howerver, they may produce two different result for a userdata or a
table that override the metamethod correctly(ignore the bad cases).
Provide a way to let them result both true?
For compatiblity, other than allow it for __eq metamethod, a better
way will be add a new metamethod entry like __peq (equal to primitive

I got the idea when I found out there is no way to make'int',1)==1 for standard lua. I think you may advise me to add
a method like ffi.equals or patch the vm by myself(patch every
version? a diff file?).  All of them are possible ways. But if lua
does support it, it will be less time-consuming to port luajit codes
to lua since luajit seems dying.