Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!uc!cs.umn.edu!cybrspc!roy From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail) Newsgroups: comp.lang.c Subject: Re: switch break Keywords: switch break first language Message-ID: Date: 7 Oct 90 03:39:22 GMT References: <1990Oct5.165846.2461@Neon.Stanford.EDU> Organization: Villa CyberSpace, Minneapolis, MN Lines: 39 dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) writes: > In article roy%cybrspc@cs.umn.edu (Roy M. Silvernail) > writes: > >Continue, though, is already a keyword for loop control. Giving it two > >seperate and context-dependant tasks would, IMHO, _really_ screw people > >up. > > Break, though, is already a keyword for loop control. Giving it two > separate and context-dependent tasks would, IMHO, _really_ screw people > up. > > Oh hell, I guess they'll muddle through somehow. Actually, Dave, I didn't really present my point clearly. I should have said "seperate, context-dependant and _differing_ tasks". The break keyword, of course, is used now to: 1) terminate a case in the switch statement. 2) force immediate termination of a for, while or do loop. Thinking about this, I find both uses consistant with each other, as they both stop the current iteration of a control structure. The suggested addition to continue, though, isn't consistant. Currently, continue causes the current control structure to reiterate. The suggested use within a switch would do exactly the opposite, and cause the control structure to progress. A switch can be viewed as a loop that only executes once. Redefining continue within a switch? Just a disaster waiting to compile. (ask the nameless AT&T programmer about break vs. if...) But you're right... we'll all muddle through. ;-) -- Roy M. Silvernail |+| roy%cybrspc@cs.umn.edu |+| #define opinions ALL_MINE; main(){float x=1;x=x/50;printf("It's only $%.2f, but it's my $%.2f!\n",x,x);} "This is cyberspace." -- Peter da Silva :--: "...and I like it here!" -- me