Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!lll-lcc!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: gotos and switch statements -- mild proposal Message-ID: <527@sugar.UUCP> Date: Thu, 20-Aug-87 19:33:16 EDT Article-I.D.: sugar.527 Posted: Thu Aug 20 19:33:16 1987 Date-Received: Sun, 23-Aug-87 11:23:27 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> <1334@killer.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 30 Summary: Don't want nor need "'" in "gotos". goto does not have a meaningful posessive. First of all, I'd like to say that anyone who doesn't like the current semantics for switch statements is a wimp and a pascal fanatic, but since I'm a nice guy I won't. Secondly, all the suggestions you've come up with, both for getting rid of the fall through and for the case are both irrelevent and dangerous. Yes, dangerous... because they all lead to semantic ambiguity. How about the following: #define CASE(x) switch(x) { #define OF(y) break; case y: y: ; #define ESAC } Now you can gross everyone out: CASE(c) OF(NEWLINE) blah blah blah; OF(TAB) goto SPACE; OF(SPACE) blah blah blah wow; ESAC This shouldn't be inefficient if you have a halfway decent compiler. Happy? -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)