lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.

On Fri, May 13, 2022 at 12:10 AM Petri Häkkinen <petrih3@gmail.com> wrote:

On 13. May 2022, at 6.46, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:

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.

https://luau-lang.org/syntax#continue-statement

Petri