The Sins of K&R

william E Davidsen davidsen at antarctica.crd.GE.COM
Wed Oct 3 02:05:00 AEST 1990


In article <12180 at crdgw1.crd.ge.com>, volpe at underdog.crd.ge.com (Christopher R Volpe) writes:

|> How about combining the "let's make break implicit" idea with the
|> "lets add ranges and lists" idea and solve everybody's problems? E.g.:
|> 

  Ranges were discussed by X3J11, but not added to the language. Pity.

  All this doesn't solve the problem that it is a lot easier to use
break to get out of a switch than to use goto's to simulate fallthrough.
Look at some existing code and see what it would look like changed.

  Once upon a time there was a language called FLECS, which compiled
into FORTRAN. We modified it locally in a number of way, including two
forms of case statement, one of which fell through and one which didn't.
Another construct which looks like a switch but doesn't fall through
would be a way to solve this without breaking old programs. That doesn't
mean I think we need it.

  I really did like the endcase statement, from the standpoint of not
overloading the use and meaning of break. Then again, people who ever
used BCPL are getting fewer and harder to find.



More information about the Comp.lang.c mailing list