[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: upcoming changes in Lua 5.2 [was Re: Location of a package]
- From: "alex.mania@..." <alex.mania@...>
- Date: Thu, 21 Feb 2008 14:31:00 +0900
On Wed Feb 20 20:32 , 'Jérôme Vuarand' <firstname.lastname@example.org> 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.