[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work3) now available
- From: Peter Cawley <lua@...>
- Date: Wed, 19 May 2010 21:04:51 +0100
On Wed, May 19, 2010 at 9:01 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
>>> If both do exactly the same, the logical thing to keep would be ipairs,
>>> not the numeric loop. Simplifies the language.
>
>> FWIW, I would second that. Drop the numeric loop. And keep ipairs alongside the generic for statement.
>
> Err... How would you write this then?
>
> for i = 1, 100 do
> print("I would never use numeric for again")
> end
for i in function(s, v) if v ~= 100 then return v + 1 end end, nil, 0 do
print("I would never use numeric for again")
end
(I hope Petite Abeille was being sarcastic)