beejjorgensen/bgc

31.2 Labeled continue: suggestion: triple nested loop

Closed this issue · 1 comments

In the chapter you show an example of a goto statement as a labeled continue.
In order to achieve the same functionality you would use a break in this case, I think.
One thing that you could not achieve with a simple break would be to continue in the outer look of a 3 nested deep loop.
With such an example, there would be no other way than goto.
Another example would be to continue outside of the double nested loop (you already have this one further down as an example of a labeled break)

In rust they have a seldom talked about feature to break out of a double loop, that is similar.

LOL--you're totally right. I got so wrapped up in that multilevel continue I forgot that break existed for the moment. Fixed in next release. 👍