[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: upcoming changes in Lua 5.2 [was Re: Location of a package]
- From: Steve Heller <steve@...>
- Date: Thu, 21 Feb 2008 08:23:36 -0800 (PST)
--- Roberto Ierusalimschy <roberto@inf.puc-rio.br>
wrote:
> > Second, in my opinion, __index and __ipairs
> (whatever the final
> > semantics may be) are not comparable. __index is
> triggered on access
> > to non-existent keys and __ipairs would be used to
> redefine the way an
> > array-like table is iterated, right?
>
> Right. (The semantics is that __ipairs, if present,
> is called and its
> result is the final result of ipairs. So __ipairs is
> not called on
> each iteraction; it is called before the loop to
> return an iteraction
> function.)
Will this fix the problem with proxy tables described
in the section called "tracking table accesses" on
page 126 of "Programming in Lua", 2nd edition? That
would be a very nice feature.