lua-users home
lua-l archive

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


Am 15.08.2014 um 20:10 schrieb Coda Highland:
On Fri, Aug 15, 2014 at 11:01 AM, Jan Behrens
<jbe-lua-l@public-software-group.org> wrote:

And some drivers don't. It would be nice to be able to use ipairs(...)
here as well. What's the sense of ipairs anyway, if it behaves the same
as the arithmetic "for"?

-- Jan


That question is the reason ipairs() was nearly removed. Parallel
construction is the only reason I can see for it -- making iteration
over a sequence visually the same as iteration over any other
well-defined collection.

... and allow passing an iterator from/to functions, and allow iteration of arrays with holes, and iterate queues (arrays which have elements appended during iteration).



/s/ Adam


Philipp