r/lua • • 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

41 comments sorted by

View all comments

Show parent comment

2

u/Dimensions_forever Mar 02 '26

sometimes goto won't work because something or another can't enter local declaration or smthn I don't remember the error, but the fix was putting most of the code in a do end block, which kinda defeated the purpose of having a goto statement (to denest & clean up code)