lua-users home
lua-l archive

Re: labels

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


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

AltStyle によって変換されたページ (->オリジナル) /