[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: An alternative to the "continue" statement
- From: "Javier Guerra" <javier@...>
- Date: Tue, 26 Feb 2008 09:12:28 -0500
On 2/26/08, Fabien <fleutot+lua@gmail.com> wrote:
> Basically, it lets qualify a loop header with additional properties like
> "if", "while", "until", "for". Many "break"s in for loops can be replaced
> with:
i like this. of course, 'deep' breaks are usually convenient. 'deep'
continues not so much, IMO.
taking it to an extreme, i think 'if', 'while', 'until' and 'for'
(both variants) could be chainable blocks, terminated by a 'do' or
'then' ('else' too?), so you could write:
for k,v in pairs(t) while itsok(k) do
...
end
if whatever(x) until finish(y) then
...
end
while going(a) if keeps(b) for c=ever(d) until tired(e) do
...
end
does that make any sense??
i kind of like it... but not sure... it's weird
--
Javier