Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!greg From: greg@utcsri.UUCP Newsgroups: comp.lang.c Subject: Re: goto's and switch statements -- mild proposal Message-ID: <5301@utcsri.UUCP> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: utcsri.5301 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Sun, 23-Aug-87 23:44:01 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> <298@auvax.UUCP> <10265@orchid.waterloo.edu> <6289@brl-smoke.ARPA> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 28 Summary: In article <6289@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <10265@orchid.waterloo.edu> rbutterworth@orchid.waterloo.edu (Ray Butterworth) writes: >> case 'a' :: 'z' : > >There's another serious problem underlying all these suggestions; >namely, that "a through z" has a well-defined meaning. Working [...] >in a general, i.e. international, environment. Personally I >think any assumption that there is a standard "dictionary order" >based solely on "letter" sequencing for a given language is naive. > >Probably an application would be much better off using > if ( isalpha( c ) ) > ... >or some other function instead. That is more likely to >give the desired behavior outside the USASCII environment. If you want it to run fast, and be portable: switch(char_class[c])[ case IS_UPPER: /*etc*/ ...with char_class pre-stuffed using isupper, etc. Or generate the entire switch automatically using another program. -- ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg Have vAX, will hack...