[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: ‘continue’ keyword
- From: Ryan Starrett <pyryanggg@...>
- Date: Fri, 13 May 2022 07:17:48 -0400
LuaU is almost a complete rewrite of Lua, it's different in thousands of small facets and it usually creates an awfully apples to oranges explanation. The goto keyword since Lua 5.2 is very versatile and also, as a byproduct, implements the same functionality we'd see from the continue keyword. In my opinion, it'd be redundant to add the continue keyword and it'd only add more space and maintenance overhead to the language.
Of course, Lua can disallow using the "continue" keyword in some loops and allow it in other loops, but it looks too weird to be included in the language, instead another weird but versatile operator ("goto") was introduced.
Luau has continue and practically speaking it does not create any confusion or weirdness than I’m aware of. It raises an error in the repeat case. Continue is also not a keyword, so it does not break existing scripts using continue as a identifier. I like it.