lua-users home
lua-l archive

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


> But then I don't understand why ipairs has to go either - not much
> code involved.  Again, it is a well-understood pattern that we all
> know, why throw it away?   Alexander says that it it is significantly
> slower than numeric-for, but this is only the kind of thing you will
> notice with trivial loop payloads.  So the definition of 'significant'
> is in question here.

Trivial loop payloads are not so rare. (But that's not the reason I'm
for removing ipairs)

In my practice, ipairs in the 5.1 variant confuse users as they do not
follow the table size rule.

And old 5.2 variant is nothing better than numeric loop. Array part of
table iteration is a hard topic for newbies in Lua — it is better to
keep it as simple and one-way as possible. So, my opinion that it is
better to remove ipairs.

That being said, my strong opinion is that if there would be
deprecated version of ipairs in the 5.2, it must be 5.1 ipairs, not a
new variant. No sense in requiring user's to adapt their code twice.

Alexander.