lua-users home
lua-l archive

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

On Wed Feb 20 20:32 , 'Jérôme Vuarand' <> sent:

>Why is the new ipairs using an __ipairs metamethod rather than the
>existing __index ?

I was wondering that too.. Maybe because __index can make tables effectively
infinite, or to prevent errors being thrown on tables that don't allow indexing
invalid keys. Still, it makes more sense and would have greatly less overhead.

Although I do prefer __pairs to __next, personally.