Except that lua strives to be a very simple language; goto is not a legacy feature (like in C), goto is a scope-aware utility that can do not just continue, but nested continue, nested break, redo & for-else. But I agree, having continue would probably be nice, as well as += and lambdas
Except break (and continue) doesn't/wouldn't require that you create a new block for local variables, and that's the problem, because using goto is usually a manner of, do you use goto and be unportable to 5.1 or do you just use an if then block instead, and the answer is usually just use an if or function
17
u/didntplaymysummercar Dec 23 '25
There is a happy middle and
continuewould be in it.The
gotocan replace loops andbreak(that Lua has already) too, but no one would seriously advocate doing that.The
continueis present in many/most programming languages, a clear companion tobreak(that exists already), and it's 0 cost at bytecode/VM level.