r/lua • u/DrSergei • Feb 26 '26
Help Why is there NO "continue" in Lua?
I was stunlocked to find out that there is no "continue" instruction for loops in Lua. Why is that? It seems so natural to have it.
I saw some scripts where goto is used for mimicking continue statements, but It's honestly not the so;ution I would comfortably accept...
26
Upvotes
View all comments
Show parent comment
6
u/nadmaximus Feb 27 '26
Yes but any time it is the obvious solution to something - particularly when its inclusion in the language is for exactly this kind of usage...that's the time to use goto. If you want to feel a little naughty when you do, that's fine.