lua-users home
lua-l archive

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

> 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

-- Roberto