lua-users home
lua-l archive

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


On Wed, May 19, 2010 at 8:59 AM, David Kastrup <dak@gnu.org> wrote:
> If both do exactly the same, the logical thing to keep would be ipairs,
> not the numeric loop.  Simplifies the language.

Yes, but not all loops go from 1 to #t ;)   You'd have to regress to
using while statements and remember the troublesome i = i + 1 etc at
the end.

>  _And_ you can pass
> ipairs around, as a function argument, as a data structure element,
> whenever the receiver needs any old iterator.

Very easy to write ipairs in Lua, if needed. But I'm still not
convinced that we need to simplify the language to this point!  For
one thing, there's _lots_ of code that uses ipairs.

steve d.