Proposed Enhancement to select/case (yes, I know...)

Henry Spencer henry at zoo.toronto.edu
Sun Sep 2 08:43:36 AEST 1990


In article <1990Aug31.134248 at ee.ubc.ca> mikeb at salmon.ee.ubc.ca writes:
>         case 'A'..'Z': printf ("upper case\n"); break;

Heh heh.  What does this do on an EBCDIC machine?  Not what you think!
POSIX 1003.2, which unlike the GNoids has seriously *thought* about the
problem, eventually decided that use of such ranges was inherently
unportable.  It also has a problem in that it is Anglocentric:  the
intent is presumably to pick up all uppercase alphabetics, but that
is *not* necessarily A through Z.  1003.2 has made some minor extensions
to regular-expression syntax, for example, so you can really say "match
any uppercase alphabetic", rather than saying "match A through Z" and
hoping that's right.
-- 
TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology
OSI: handling yesterday's loads someday|  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.std.c mailing list