[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: I'd give my right arm for a continue statement
- From: Philippe Lhoste <PhiLho@...>
- Date: Fri, 28 Jan 2011 22:17:24 +0100
On 28/01/2011 12:19, Roberto Ierusalimschy wrote:
I think the semantics is quite clear: "break :label:" exits the
block with that label, continuing normal execution exactly after its
corresponding "end".
Ah, explained like that, it is indeed clear. Somehow, I was looking hard
for a continue, while you were providing a goto, ie. a more versatile tool.
Sorry for the confusion.
Some people regretted it needed an extra level of indentation, but
somehow it can be condensed to something like:
while cond do do :process_item:
-- code, code, code
-- some conditional
break :process_item:
-- code, code...
end end
Although the stutter might seem a little strange... :-)
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
- References:
- I'd give my right arm for a continue statement, Steve Litt
- Re: I'd give my right arm for a continue statement, steve donovan
- Re: I'd give my right arm for a continue statement, HyperHacker
- Re: I'd give my right arm for a continue statement, Michal Kottman
- Re: I'd give my right arm for a continue statement, steve donovan
- Re: I'd give my right arm for a continue statement, Alexander Gladysh
- Re: I'd give my right arm for a continue statement, steve donovan
- Re: I'd give my right arm for a continue statement, Roberto Ierusalimschy
- Re: I'd give my right arm for a continue statement, Philippe Lhoste
- Re: I'd give my right arm for a continue statement, Roberto Ierusalimschy