Re: An alternative to the "continue" statement
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: An alternative to the "continue" statement
- From: Fabien <fleutot+lua@...>
- Date: 2008年2月26日 16:08:32 +0100
All your examples are accepted by xloop, except "
if whatever(x) until finish(y)" (I wonder what meaning it could have actually). You can write "
while not finish(y) if whatever(x)", though, and it would be possible to add "
until...do...end" and "
repeat...while..." loops; arguably, it would even make the extension more homogeneous.
Another thing you can do is collapsing for loops together. You save an indentation level, and more importantly, breaks escape both loops:
for i=1,10 for j=1,10 if i~=j do
... endI plan to try a couple more stuff on this base, many of them loosely inspired by Common Lisp's loop macro.
-- Fabien.