[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: index/newindex on a table
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 04 Oct 2002 13:44:23 -0300
> In this case, I have overridden the global table, providing global variables
> with dynamic values. This was working fine previously (using gettable) but
> I can't seem to get it working - any ideas?
Unlike __gettable, __index is only called when the table does not have
that element. If you want to call __index (and __newindex) on *every*
access to a table, you must make sure the table is empty. (For instance,
we can store the elements in another table, and the empty talbe works as
a proxy to the "real" table.)
-- Roberto