[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What does metamethod equality mean? (long) (Was: Re: Need for help)
- From: RLake@...
- Date: Fri, 21 Feb 2003 12:22:04 -0500
> Which makes me wonder... if table key comparison was extended to include
an
> "eq" metamethod would there be any remaining need for a "reference
> equivalence" test? It is not that unreasonable that two "__eq" values
might
> key the same for a table...
If you think about that for a minute, you will see how difficult
implementation would be. To make tables work, you need a hash function, and
writing hash functions to correspond with random __eq methods is
non-trivial. Otherwise, you would be reduced to a linear search of tables
for key equality on every lookup.
R.