[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Comparing userdata with other types
- From: Patrick Donnelly <batrick@...>
- Date: Sun, 31 May 2009 21:08:40 -0600
On Sun, May 31, 2009 at 5:29 PM, <firstname.lastname@example.org> wrote:
> That's actually rather scary. You realise that all numbers share the same
> metatable, right? So not only are you impacting the comparison of your value
> NIL but also every other numerical comparison. This could lead to problems
> in the future, especially if the developer is unaware of this change. (I
> HAVE written, and still rely upon, code which relies upon the fact that NaN
> != NaN)
You needn't worry. Numbers fall in the special case where the __eq
metamethod (among many others) is ignored.
"Let all men know thee, but no man know thee thoroughly: Men freely
ford that see the shallows."
- Benjamin Franklin