[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: I'd give my right arm for a continue statement
- From: Leo Razoumov <slonik.az@...>
- Date: Thu, 27 Jan 2011 16:56:54 -0500
On Thu, Jan 27, 2011 at 16:44, Leo Razoumov <firstname.lastname@example.org> wrote:
> On Thu, Jan 27, 2011 at 11:42, Roberto Ierusalimschy
> <email@example.com> wrote:
>> 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:
>> do :label:
>> Then, a continue could be written like here:
>> while cond do
>> do :process_item:
>> break :process_item:
> this is great! Not only it would allow "continue" but this mechanism
> will also provide means to break from multiple nested loops in one go.
I guess more accurate statement should be: Allow "continue" across
multiple nested loops in one go.