Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decwrl.UUCP Path: utzoo!linus!decvax!decwrl!dec-rhea!dec-mrvax!ddb From: ddb@mrvax.DEC (DAVID DYER-BENNET MRO1-2/L14 DTN 231-4076) Newsgroups: net.lang.c Subject: Proposal for breaking out of multiple loops Message-ID: <3883@decwrl.UUCP> Date: Wed, 10-Oct-84 10:51:56 EDT Article-I.D.: decwrl.3883 Posted: Wed Oct 10 10:51:56 1984 Date-Received: Fri, 12-Oct-84 05:31:29 EDT Sender: daemon@decwrl.UUCP Organization: DEC Engineering Network Lines: 23 This is an extremely valuable feature; its use makes for much more readable, structured, code than anything except the "goto" approach, and it is clearly superior to that as well (just not as much). The proposed method, assigning a "label" to a block of code and then saying "break label;" to break out of that block, is exactly the correct way of doing it, in my opinion. Bliss has such a feature, which I have used, and find quite useful. There is another way of doing it, brought to mind by calling this a "break n" capability. This way of doing it is, in my opinion, WRONG WRONG WRONG! The older Bliss-10 language had an "exitloop n" construct where n was the number of enclosing loops you were going to exit from. First, this was hard to read, because you had to carefully find all the loops, and count them. Far worse, however, was that the addition of another loop surrounding the code in question could cause it to become invalid!!! Obviously, this gets worse very rapidly (exponentially?) as the value of n increases. So, my vote: "Break label" Yes Yes Yes "Break n" No No No -- David Dyer-Bennet -- ...decwrl!dec-rhea!dec-mrvax!ddb