[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index overloading only for non-existing keys?
- From: Mark Hamburg <mhamburg@...>
- Date: Thu, 10 Jul 2003 09:43:17 -0700
on 7/10/03 6:17 AM, Wim Couwenberg at w.couwenberg@chello.nl wrote:
> That's right. That changed from Lua 4 to Lua 5. If you
> want to trap all index access you can use what is known as
> a "proxy": an empty table (that stays empty) while __index
> references the "actual" table. By the way, __index will
> always be used/called for userdata (if present.)
I stumbled across needing to do this in order to catch __newindex
operations. The problem with this is that it then breaks things like table
iteration. Any advice on how to make this work?
Mark