[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (work3) now available
- From: Shmuel Zeigerman <shmuz@...>
- Date: Wed, 19 May 2010 10:15:11 +0300
David Kastrup wrote:
The point is that it does exactly the same that a numeric loop, so
there was no point in keeping it.
If both do exactly the same, the logical thing to keep would be ipairs,
not the numeric loop. Simplifies the language. _And_ you can pass
ipairs around, as a function argument, as a data structure element,
whenever the receiver needs any old iterator. You can't pass a "numeric
loop" around other than wrapping it into a closure.
I'd like ipairs to stay. Otherwise most of my code will be polluted with
an additional line, e.g.
for k = 1, #arr do
local v = arr[k] -- this wasn't needed with ipairs