[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: continue keyword - since there is goto now, maybe reconsider continue?
- From: Jonas Thiem <jonasthiem@...>
- Date: Thu, 9 Jan 2014 00:40:21 +0100
Since there is now a working goto in Lua, I suppose there is no longer
any technical reason why there is no continue.
In case that's true, I would like to point out that goto as a
continue-replacement isn't very nice:
It needs twice the lines (goto statement + label), and you need to
make up a unique jump label per loop if you got multiple loops in a
function with such a continue workaround.
Also, you can easily mix up your jump labels and suddenly jump into
one of the other loops and generate non-obvious, huge bugs with that.
What about natively supporting continue in an upcoming Lua version? I
would be using it a lot, I do in all other programming languages which
usually have it.
- Follow-Ups:
- Re: continue keyword - since there is goto now, maybe reconsider continue?, Sean Conner
- Re: continue keyword - since there is goto now, maybe reconsider continue?, Luiz Henrique de Figueiredo
- Re: continue keyword - since there is goto now, maybe reconsider continue?, Andrew Starks
- Re: continue keyword - since there is goto now, maybe reconsider continue?, Ulrich Schmidt
- Re: continue keyword - since there is goto now, maybe reconsider continue?, Roberto Ierusalimschy
- Re: continue keyword - since there is goto now, maybe reconsider continue?, David Demelier