[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: I'd give my right arm for a continue statement
- From: Philippe Lhoste <PhiLho@...>
- Date: Thu, 27 Jan 2011 18:06:57 +0100
On 27/01/2011 17:42, Roberto Ierusalimschy wrote:
If that could save Steve's right arm, we like the idea of break with
Interesting to have an official opinion...
In Lua, we cannot have traditional labels, because the syntax "foo:"
already has a different meaning. Instead, a simple syntax would be to
add labels only to "do end" blocks, for instance like this:
Then, a continue could be written like here:
while cond do
Well, will that execute the cond and exit if not satisfied?
Why not do:
while cond do :process_item:
There are several details that could change (other mark instead
of colons, whether the label after break needs marks, whether an
optional [or mandatory] label could be added after the corresponding
'end', etc.), but the basic idea would not change much.
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --