lua-users home
lua-l archive

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


I also thought I should make a public cross off table, when coding any
algorithmn like I'm used to for decades and then suddendly realize
"argh, cant use continue", and have to do some kind of wierd work
around, add a cross to it.

There are some work arounds, none is perfect, and all of them have in
common, they effectively obfustucate your code making it more
difficult to read. Sometime the if ... then for the rest of the loop
works and only makes an otherweise unnecessary intendation, but
sometimes you need a "true" continue.

Yes
[Loop] repeat
   ...
   break; --- this is actually a continue!
   ....
until true end;

Is the best workaround with the least obfustication. Dont forget to
add the "break is actually continue" comment, otherwise anoter human
will be puzzled without end.

If you are in a project where you can patch your lua, a continue patch
is easily worth it. If you are in a project (like me) where you have
to do what the standard distros give you, you'll have to keep
workarounding. It continues to be an annoyance but it is no show
breaker.

On Sat, Jan 22, 2011 at 9:00 AM, Steve Litt <slitt@troubleshooters.com> wrote:
> Hi all,
>
> I'd give my right arm for a continue statement within a loop. I know it's
> lousy programming technique, but when you're counting but not processing blank
> lines, it comes in very handy so you don't need to put the majority of a loop
> in a very long if statement.
>
> Have any of you found convenient ways to simulate a continue statement in Lua?
>
> Thanks
>
> SteveT
>
> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US
> Twitter: http://www.twitter.com/stevelitt
>
>
>