range types in C

uunet!cup.portal.com!pls uunet!cup.portal.com!pls
Wed Jan 1 20:35:54 PST 1992


Paul Eggert objects to the syntax
  int {MIN...MAX}
because MIN...MAX is a single token and the preprocessor won't expand MIN and
MAX.

Richard Stallman objets to |MIN:MAX| because he would like to see ranges in
case statements using the same syntax, and you can't use a : there.

Seems to me:
1. The range being talked about here is a range of bit length. The range in
   a case statement is a range of values. As long as these are different
   things, I see no problem with using a different syntax.

   Of course, you could go with Pascal and use a value range in the definition.
   Then the syntax should be the same. I prefer this, myself.

2. In the case of {MIN...MAX} would you not have to also define ... as being
   an operator? In that case, the preprocessor would expand MIN and MAX. Then
   you have that operator available for other uses, such as in case statements,
   array slice assignments, and so on. Sounds useful.

    ++PLS



More information about the Numeric-interest mailing list