problems/risks due to programming language, stories requested

Jacob Gore jacob at gore.com
Fri Mar 16 09:26:19 AEST 1990


/ comp.lang.c / a563 at mindlink.UUCP (Dave Kirsch) / Mar 14, 1990 /
> Do this in Pascal:
> 
> switch (i) {
>   case 2 :  /* Add 2 to j */
>     j++;
>   case 1 :  /* Add 1 to j */
>     j++;
>   case 0 :  /* Print j out */
>     printf("%d\n", j);
>     break;
>   default :
>     printf("Illegal value in switch.\n");
>     abort();
> }

	if i in [0..2] then begin
	    j := j + i;
	    writeln(j);
	end else begin
	    writeln("Illegal value in switch.\n");
	    abort;
	end;

Jacob
--
Jacob Gore		Jacob at Gore.Com			boulder!gore!jacob



More information about the Comp.lang.c mailing list