[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: I'd give my right arm for a continue statement
- From: Axel Kittenberger <axkibe@...>
- Date: Sat, 22 Jan 2011 10:05:38 +0100
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.
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
On Sat, Jan 22, 2011 at 9:00 AM, Steve Litt <email@example.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?
> Steve Litt
> Recession Relief Package
> Twitter: http://www.twitter.com/stevelitt