Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!teddy!panda!talcott!harvard!breuel From: breuel@harvard.ARPA (Thomas M. Breuel) Newsgroups: net.lang.c Subject: goto's in 'C' Message-ID: <308@harvard.ARPA> Date: Sun, 20-Jan-85 07:36:00 EST Article-I.D.: harvard.308 Posted: Sun Jan 20 07:36:00 1985 Date-Received: Mon, 21-Jan-85 03:39:24 EST Distribution: net Organization: Harvard University Lines: 18 >[Rob Warnock:] >The incidence of the "goto" in C code is so rare anyway, I dare say >we could abolish it altogether (replacing it with BLISS's "leave") >and not miss the loss. (I certainly never missed it in BLISS.) I would miss it. I have never used it for breaking out of loops or making loops in the conventional sense. It is extremely useful, though, for 'hardcoding' finite state machines. If they contain more than say 3 or 4 states, the use of structured constructs is awkward. One example where I have used 'goto' is in a non-recursive threading garbage collector. Indeed, rather than abolishing it, what about permitting indirect goto's (something which, so rumour has it, existed in some older versions of the 'C' compiler). Why? Well, it is useful if you have to maintain your own evaluation stack or avoid explicit recursion. Thomas.