[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: "continue" construct in Lua loops
 
- From: roberto@... (Roberto Ierusalimschy)
 
- Date: Thu, 21 Dec 2006 11:21:10 -0200
 
> So far my best shot is using
> "break" inside of "repeat ... until true" block, see below
> 
> for i=0,9 do
>  repeat
>    if i>=3 and i<=7 then break end  --exclude i= 3,4,5,6,7
>    print(i)
>  until true
> end
> 
> Is there a more elegant way?
No :(  (At least you can be confident that the generated opcode is
as good as for a primitive continue ;)
-- Roberto