Proposed Enhancement to select/case (yes, I know...)
Peter Holzer
hp at vmars.tuwien.ac.at
Wed Sep 5 07:13:50 AEST 1990
burley at world.std.com (James C Burley) writes:
>Anyway, in case you missed it, the issue has been "decided". GNU C already
>implements such a construct; and it is a widely used compiler. When the
>next standard begins "happening", it will be up to the committee (with all
>our input) to determine whether ranges (and lists) are useful and simple enough
>to add, compared to the costs of any possible lack of portability being
>introduced.
No. GCC does not implement that construct (at least version 1.37.1
does not, and I think this is about the newest version (although I heard
about 1.37.92 -- what's that?)), but G++ does.
And the fact that ONE _C++_ compiler implements a feature is not likely to
count as prior art of_C_ .
>Meanwhile, I personally would not use the range feature for the above case
>except in some kind of quick&dirty throwaway program. I'm looking to it
>more as an elegant way to deal with natural (i.e. portable) ranges that occur
>in applications, and cases where the switch (not select, as I'm wont to say
>as a Fortran-90 victim) statement and it's case statements are being written
>by someone who does not (or should not/doesn't want to) know the values of
>#define constants for the cases (presumably kept in an #include file) but
>still wants to handle ranges. Nothing wrong with that, I wouldn't think.
Agreed. Ranges do have their advantages, and although I do not need
them (I can use if () else if () ..., but then I do not need case (),
either), I would not mind having them in a C compiler (GNU people, are
you listening ?)
--
| _ | Peter J. Holzer | Think of it |
| |_|_) | Technische Universitaet Wien | as evolution |
| | | | hp at vmars.tuwien.ac.at | in action! |
| __/ | ...!uunet!mcsun!tuvie!vmars!hp | Tony Rand |
More information about the Comp.std.c
mailing list