[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Will operator '==' support fulluserdata and number or nil or false
- From: 奥斯陆君王 <qtiuto@...>
- Date: Sun, 24 Feb 2019 20:50:07 +0800
I just want to compare a number and a fulluserdata, and I know it's
important to ensure value of different type not equal. But only
compare number and fulluserdata won't affect anything. Secondly, tt
doesn't break any rule in current __eq metamethod, because a new
metamethod will be used. Thirdly, It doesn't affect performance,
because only number type will be affected and fastmt will make sure
only one table search will be performed if the userdata doesn't define
such a metamethod. Fourth, fasttm tag still 3 bit unused. Fifth, If
you want to make sure the value is number, a type check will be faster
and safer than an equal call. If comparsion for string and number is
ok, why can't it be extended.