Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!alberta!auvax!rwa From: rwa@auvax.UUCP (Ross Alexander) Newsgroups: comp.lang.c Subject: Re: goto's and switch statements -- mild proposal Message-ID: <298@auvax.UUCP> Date: Thu, 13-Aug-87 07:08:16 EDT Article-I.D.: auvax.298 Posted: Thu Aug 13 07:08:16 1987 Date-Received: Sat, 15-Aug-87 09:45:52 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> <1100@geac.UUCP> Sender: news@auvax.UUCP Organization: Athabasca U., Alberta, Canada Lines: 22 Summary: another case proposal... In article <1100@geac.UUCP>, daveb@geac.UUCP (Brown) writes: > This is NOT a proposal for C (its for P, as in BCPL). > One should restrict the range of gotos referring to switch/case/whatever > labels to the body of the switch, as in: > case 'f' | 'e': -- one possible syntax... > goto case 'a'; -- another possible syntax A long time ago, when I was young and dinosaurs roamed the woods, I did some hacking in a dialect of B called B+ (Reinhaldo de Braga, take a bow). It supported a construct in case labels that we called 'a range case'. it looked something like case 'a' - 'z' : and could be mixed with regular case labels and 'default' quite freely. The impementation was very compact and efficient on the particular architecture if the domain of cases wasn't too sparse, and the syntax was very handy - I didn't want to enumerate the alphabet (yes, that raises EBCDIC problems, but everything has gotcha's) in the example above, and this way I didn't have to. ...!ihnp4!alberta!auvax!rwa Ross Alexander @ Athabasca University