The D Programming Language: cases

ELIN Forsch.z. rcvie at tuvie
Wed Mar 23 18:10:11 AEST 1988


In article <336 at wsccs.UUCP< terry at wsccs.UUCP (terry) writes:
<Given that the syntax is only for demonstration, I would suggest the following
<as a better (more backward compatable) method:
<
<		switch( e) {
<		case 1,2,3,4:
<		}
<
<While apparently at conflict with the comma operator, one should realize that
<the compiler expects a constant, not an expression, following a case statement,
<so there would be no ambiguity in parsing.
<

Just spell it correct. The compiler expects neither a `constant' nor an
`expression' but a `constant expression'. As, however, the comma operator
must not be part of a constant expression (as far as my dpANS-edition says)
there still is no ambiguity. But this restriction is still discussed.

		Dietmar Weickert,
			ALCATEL-ELIN Research Center, Vienna, Austria.



More information about the Comp.lang.c mailing list