[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: labels
From:       Yutaka Ueno <ueno () etl ! go ! jp>
Date:       2000-06-19 0:54:04
Message-ID: 20000619005405.23711 () etlpom ! etl ! go ! jp
[Download RAW message or body]

Luiz Henrique de Figueiredo wrote :
>We are now inclined towards removing these labels (but keeping "break".)
>Would anyone have a *good* use for labels?

There is my idea, but I am not sure if this is possible.
Here, a function label() is a kind of setjmp().

local label1,label2

    label1=label()
    while(1) do
        label2=label()
        while(1) do

            ...
            break(label1)
        end

        ...
        break() -- nil : the current loop
    end

---ueno

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic