lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Sep 12, 2005 at 11:06:37AM -0700, Chris Marrin wrote:

> >Here is another example where a standard way to do non-local exit would
> >help.  The syntax was proposed in
> >http://lua-users.org/lists/lua-l/2005-08/msg00357.html
> 
> Javascript (and others) do this with labelled break and continue. It 
> lets you do this:

The advantage to the block(nle) ... end form is you can pass the
non-local exit as a parameter to functions, so it can serve as an
exception system.  I just tried to show another use that would avoid
cluttering the language with more keywords (break,continue,etc.).

Cheers!

-- 
Shannon Stewman         | Let us walk through the waning night,
Caught in a whirlpool,  | As dawn-rays tickle our toes, the dew soothes
A quartering act:       | Our blistered soles, and damp bones stir
Solitude or society?    | As crimson cracks under the blue-grey sky.