Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hprnd!hprmokg!tom From: tom@hprmokg.HP.COM (Thomas Vachuska) Newsgroups: comp.lang.ada Subject: Re: problems/risks due to programming language, stories requested Message-ID: <30160002@hprmokg.HP.COM> Date: 23 Feb 90 18:11:23 GMT References: <9790@medusa.cs.purdue.edu> Organization: HP Networked Computer Mfg. Operation Lines: 24 Maybe I am missing the point here, but to the best of my knowledge Ada "exit" statement is allowed only within a "named loop|loop" statement (unless it appears in a "subprogram|package|generic|task|accept body" which is enclosed within that "loop" statement, to be precise). And as far as I know similar restrictions apply for the use of the C "break" statement which terminates the execution of either the "while|do|for" or "switch" statement. Neither of these are to abandon execution of an "if" statement block. I would agree that it is easier to get in trouble in the following situation in C which does not have a counterpart in Ada since Ada's "exit" exits ONLY the "loop" statement. switch (trouble) { case PROGRAMMER_SCREW_UP: for (;;) { break; /* intended for exiting the "switch", BUT... */ } case ... . . } Thomas Vachuska (-- Ada Addict)