Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!sri-unix!sri-spam!ames!sdcsvax!ucsdhub!jack!man!nu3b2!rwhite From: rwhite@nu3b2.UUCP (Robert C. White Jr.) Newsgroups: comp.lang.c Subject: Re: goto's in C: an opinion... Message-ID: <1125@nu3b2.UUCP> Date: Fri, 24-Jul-87 21:06:25 EDT Article-I.D.: nu3b2.1125 Posted: Fri Jul 24 21:06:25 1987 Date-Received: Sun, 26-Jul-87 00:54:58 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> <6603@think.UUCP> Organization: National University, San Diego Lines: 32 Keywords: C, goto, style Summary: Longjump In all your goto stuff I find that yhat you really want is the setjump() longjump() construct whic has been in all [both might be a better word, its been marginaly over three] the compilers I have had to work with. It would seem to address all your examples of necessary goto(s). You call setjump() and get a return code indicating the jump has been set to that point. If you later call longjump() execution skips BACK to the setjump() call but this time it exits with a diferent value you can test. This only works backwards as it mostly saves the stack frame in some global position. but it will preform a multi level "break" as long as you are on the same or lower execution branch as the setjump() call. The conditional structure seems valid enough, and as it is really a controlled, down-only, step is seems a terrific structual behavor for a language which is basicly a "portable asssembeler" [as some have called it] It is exxentially the same as a multi-level break, but it requires the structual planning to be done at the broken-to, instead of broken- from, level. by this means, extra levels [functions/loops/falderall] can be inserted in the execution tree without having to find every "break 4" and change it to a "break 5" [etc], the programmer must plan a structured response to every possible goto. Robert. Disclaimer: My mind is so fragmented by random excursions into a wilderness of abstractions and incipient ideas that the practical purposes of the moment are often submerged in my consciousness and I don't know what I'm doing. [my employers certainly have no idea]