Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!orchid!rbutterworth From: rbutterworth@orchid.UUCP Newsgroups: comp.lang.c Subject: Re: goto's and switch statements -- mild proposal Message-ID: <10265@orchid.waterloo.edu> Date: Mon, 17-Aug-87 12:40:25 EDT Article-I.D.: orchid.10265 Posted: Mon Aug 17 12:40:25 1987 Date-Received: Tue, 18-Aug-87 02:51:04 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> <298@auvax.UUCP> Organization: U of Waterloo, Ontario Lines: 23 In article <298@auvax.UUCP>, rwa@auvax.UUCP (Ross Alexander) writes: > 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 current version of B, now running on Honeywell GCOS-8 systems, uses the syntax case 'a' :: 'z' : This was suggested to the X3J11 people, but they rejected it "on the grounds that a great deal of code (or jump table space) might be generated for an innocent-looking case range such as 0 .. 65535 and that this was an unneeded innovation". That this is an addition to the language and they don't have a mandate to add new features I can accept. The reasoning that someone might write a compiler stupidly enough that it would use a jump table or 65535 explicit tests for the given example doesn't make much sense to me though.