[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: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 21 Feb 2008 13:18:35 -0300
> 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.)
-- Roberto