Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!helios!stat!john From: john@stat.tamu.edu (John S. Price) Newsgroups: comp.lang.c Subject: Re: problems/risks due to programming language Message-ID: <4310@helios.TAMU.EDU> Date: 22 Feb 90 21:56:36 GMT References: <202@puma.ge.com> <8124@hubcap.clemson.edu> Sender: usenet@helios.TAMU.EDU Reply-To: john@stat.tamu.edu (John S. Price) Organization: Texas A&M University Lines: 55 In article <8124@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes: >> Then why provide the exit statement [in Ada] at all? > > Suppose that one is in a for loop or a while loop, and some > unusual situation arises under which processing cannot continue. > The exit statement allows one to conveniently handle such cases. > Suppose, in C, that one is in a for loop or a while loop, and some unusual situation arises under which processing cannot continue. The break statement allows one to conveniently handle such cases. But, really, folks, what is the difference between ... switch(x) { case a: ... break; case b: ... break; } ... and ... case foo is when x => ... when y => ... ... (I think I remember my Ada correctly... if not, please, it's close enough)? The control structures case/when have to be terminated somehow. In Ada, it is terminated by the next when statement. In C, it's terminated by a break statement. Just deal with it. Personally, I've found some nice uses of NOT putting a break in a switch statement, when I have two similiar cases, but one has a little bit more processing that needs to be done... This is a *C* newsgroup. Why talk about the merits and disadvantages of Ada? Take it to comp.lang.ada, if there is one. People like C. Who is anyone to tell them (including me) that their opinion is wrong, or that their preference is wrong? Give it a rest. > > Bill Wolfe, wtwolfe@hubcap.clemson.edu -------------------------------------------------------------------------- John Price | It infuriates me to be wrong john@stat.tamu.edu | when I know I'm right.... --------------------------------------------------------------------------