problems/risks due to programming language

Satish Kumar .C chittamu at umvlsi.ecs.umass.edu
Tue Feb 27 09:05:25 AEST 1990


In article <10839 at june.cs.washington.edu> machaffi at fred.cs.washington.edu.cs.washington.edu (Scott MacHaffie) writes:
>In article <8133 at hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu writes:
>>   common practice to use break statements by the dozen in order to get 

>switch (x) {
>	case '0': case '1': ... case '9':
>		digit(x);
>		break;
>}
>
>ADA-C:
>switch (x) {
>	case '0': digit(x);
>	case '1': digit(x);
>	...
>	case '9': digit(x);
>}
>		Scott MacHaffie

Give me a break. In Ada, you would actually write it as

case x 
 when '0' | '1' | '2' =>
     digit(x) ;
end case;

I am sure one can come up with a reasonable syntax for the equivalent
in "Ada-C".

No personal offense intended, but if the only argument you have for
C needing breaks on a case is that you need to write only one action,
then all I can say is it is positively absurd.

-- 
	-Satish.
	chittamu at cs.umass.edu
--
The Theory of Objectivity: E = MC++



More information about the Comp.lang.c mailing list