Re:The Evolution of C Programming Practices: A Study of Unix...
by ufo on Friday May 11, 2018 @12:05PM
(#17048426)
I still hope that we might be able to convince the Lua authors to add continue one day. It would be very convenient.
I think the real reason why it hasn't been added to the language yet is that it has a weird interaction with the way Lua scopes its repeat-until loops. The justification about having a single control-flow structure is more of an excuse.
Re:The Evolution of C Programming Practices: A Study of Unix...
by samatman on Friday May 11, 2018 @05:42PM
(#17050977)
As a contrasting opinion, I would like the break keyword to be formally defined as a sugar for a special labeled goto.
Since it's a keyword, you can't create your own ::break:: label, so that would be fine.
Users were agitating for `continue` to join `break` for control flow interruption. Lua instead chose to provide all the non-structured control flows you would like as a primitive; scoping it lexically keeps it from breaking composition.