[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: finding out number of records in a table??
- From: Luis Carvalho <carvalho@...>
- Date: Tue, 12 Sep 2006 16:26:51 -0400
> >That is, I'm sorry, but I fail to see why one might need a __removeindex
> That's because you didn't try removing an index :)
True enough. :) I missed your point, but now I think the main issue here is
that for tables, if table[key] ~= nil, key/value access metamethods (__index
and __newindex) are not called; this would have to change with a new
__removeindex, and, if so, why not simply use __newindex?
I'm assuming that no "halfway" solutions are to be adopted: either we adhere to
the current table access policy and use proxies when necessary or we rely on
metamethods for more elaborate table access at the cost of losing some
efficiency due to more table lookups. IMHO, the actual approach is better
since it's more efficient and fosters the elegant use of proxies.
A mathematician is a device for turning coffee into theorems.
-- P. Erdos
Applied Math PhD Student - Brown University
PGP Key: E820854A <email@example.com>