lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

--- Roberto Ierusalimschy <>

> > 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.