Thanks. I forgot about "continue" in C, which I don't recall ever using. But this strengthens the story...
Now that Perl has "redo" and "next", both of these "continue" the loop processing so they really both had to be named something other than "continue". Plus, Perl lets you write for(a;b;c) as a;while(b){}continue{c} (I hope I got that right). It makes sense to use "continue" here since that block is what is executed whenever you decide to continue looping. So having "continue" introduce that block as well as be a loop flow modifier would probably lead to more parsing confusion. So we had to rename "continue", we might as well rename "break" as well.
I also wondered if "break" was being saved for when Perl adds a real "case" statement. I hate this in C:
What I really want to do is break out of the while loop. The work-arounds for this overloading of "break" in C are usually a bit ugly (depending on the specifics). So if Perl uses "break" for "case" statements, then I could code "last" above and get what I often want very easily. - tye (but my friends call me "Tye")while( bool ) { switch( input ) { case END: break; } }
In reply to (tye2)Re: The last command is like the break statement in C
by tye
in thread The last command is like the break statement in C
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |