Re: break bug
- Posted by useless_ Nov 09, 2012
- 1324 views
jimcbrown said...
ghaberek said...
bryanso said...
The introduction of break statement, causing a confusion between break and exit, seems to violate the principle of "say no to complicated programming".
I suppose this started because we only had exit for the longest time. And only with the recent addition of switch did we gain break.
-Greg
The reason we came up with a new keyword for switch, instead of simply reusing exit, is to allow the user to embed a switch statement inside of a loop but then use the exit keyword inside of the switch to break out of the loop.
But only if you use "with fallthru" keywords! Anything to make a goto but using different letters, eh?
switch x with fallthru case a: -- blah blah code case b: -- blah blah code i wanna leave here, was it exit or break? case c: -- blah blah code end switch
But imagine the horrors of not having "case", "switch", "exit", "break", and "with fallthru":
goto x :a -- blah blah code :b -- blah blah code ; goto :end_x :c -- blah blah code :end_x
useless