by atq2119 · 3y ago · 0 comments
They don't come up that often, but when they do they're really the best solution.
I've often wanted both a "then" and an "else" from both for and while loops. The "then" would be for a successful completion (no break), and the "else" would be for when the loop doesn't even run a single iteration.
But that didn't make it into our "language budget", unfortunately. It's easy to implement, but hard to argue for when it doesn't get used often
I feel like it would work better with a more explicit keyword, but I don't know which one. `nobreak`?