A long time ago, I thought I saw a proposal to add an else
clause to for
or while
loops in C or C++... or something like that. I don't remember how it was supposed to work -- did the else
clause run if the loop exited normally but not via a break statement?
Anyway, this is tough to search for, so I thought maybe I could get some CW answers here for various languages.
What languages support adding an else
clause to something other than an if
statement? What is the meaning of that clause? One language per answer please.