[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: equal tag method [was Re: unicode and locale again]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 27 Jun 2002 09:37:58 -0300
> However, there was (I thought) general agreement that we could compromise
> on partial ordering with the <, <=, =>, and > operators, leaving == and
> it's converse (which I cannot easily type on a Windows Spanish keyboard) to
> mean object identity.
The equal tag method is not for partial order. We implemented partial order
along the line pointed out by Reuben Tomas (an optional __le method).
The equal tag method is for completeness. It is strange that you can
define <, >, <=, and >=, but not == .
> Changing object identity to a function call would add far far too much
> overhead to what should be a basic operator.
There is a function call only when there is a tag method; they are only
checked when comparing tables or userdata. So the overhead is minimal,
with no overhead at all when comparing primitive types.