[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: table.insert/remove and metatables
- From: askok@...
- Date: Sat, 05 Jul 2008 20:47:54 +0300
Reminds me of 'unpack()', which I think does not respect
Lanes gives return values as h etc. and if 'unpack()'
respected __index one could simply 'unpack(h)' to get all
On Sat, 5 Jul 2008 15:16:16 +0800
"Alex Davies" <email@example.com> wrote:
Dr. Markus Walther wrote:
Question: Shouldn't table.insert/remove respect
__newindex) for reasons of symmetry and
I've always thought the above. I think it's left around
from old versions of Lua before metatables. Personally
I'd prefer that everything respected them, from ipairs
(should use __index) through to table.sort. Especially
seeing as the speedup is minimal by performing raw
access. Would make making proxy tables a lot easier, and
as for compatibility, I'd say using these functions to
deliberately avoid metamethods seems like incorrect use
imo. My 2c :).