lua-users home
lua-l archive

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


On Fri, Nov 5, 2010 at 17:02, Francesco Abbate <francesco.bbt@gmail.com> wrote:
> Hi all,
>
> I'm happy to announce, after a lot of work, the 1.0-beta1 release of GSL shell.
> [..snip..]
>
>  The library was (quite easily) rewritten in Lua, the most painful
> things was the lack of the "continue" statement and the different
> indexing conventions :-)

Francesco,
thanks a lot for your efforts! I will try it out.

Absence of the "continue" statement is very high on my Lua complaint
list. That said, you can emulate it using break inside repeat ...
until true construct like this:

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

According to Roberto http://lua-users.org/lists/lua-l/2006-12/msg00441.html
this method generates optimal opcodes for "continue".
Unfortunately, you cannot have "break" and "continue" behavior withing
the same repeat...until block.

Hope it helps,
--Leo--