Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!atanasoff!hascall From: hascall@atanasoff.cs.iastate.edu (John Hascall) Newsgroups: comp.lang.c Subject: Re: Oh nooo! (gotos) Message-ID: <1461@atanasoff.cs.iastate.edu> Date: 7 Sep 89 14:23:35 GMT References: <7598@goofy.megatest.UUCP> <12793@pur-ee.UUCP> Reply-To: hascall@atanasoff.cs.iastate.edu.UUCP (John Hascall) Organization: Iowa State Univ. Computation Center Lines: 39 In article <12793@pur-ee.UUCP> lewie@ecn-ee.UUCP writes: }[Dave Jones offers an example of what he thinks is a valid use of goto]: [using goto to get out of a nested control structure] }I'm sure this comes up often enough, but the reason I'd say there's nothing }wrong with this type of goto is that it is the equivalent of a continue }with a label, i.e.: }while foo (...) { } while (...) { } ... } continue foo; } ... } } }} I have often wished for something similar, my thoughts have tended toward the synatx: continue [constant-integer-expression]; break [constant-integer-expression]; where the [optional] expression indicated how many nested structures to continue or break, with the default being 1 (just like the current "continue" and "break"). While we are on the subject of loops, how do people feel about the practice of using #define to "extend" the language? For example: #define loop for (;;) #define exitloop break loop { foo(); if (bar()) exitloop; } John Hascall