Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!unmvax!uokmax!munnari.oz.au!metro!nuts!bhpese!cerberus!Sm From: Sm@cerberus.bhpese.oz.au (Scott Merrilees) Newsgroups: comp.lang.c Subject: Re: The Sins of K&R Message-ID: <1990Oct2.041030.13765@bhpese.oz.au> Date: 2 Oct 90 04:10:30 GMT References: <31604@nigel.ee.udel.edu> <12180@crdgw1.crd.ge.com> Sender: news@bhpese.oz.au (Usenet) Organization: BHP Rod & Bar, Newcastle, Australia Lines: 33 volpe@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.: >ch = getch(); >switch (ch) { > case 'q','Q',27,13: > exit_menu=1; > case 'a': > do_a(); > ...etc >} >Now, a break within a case can be used to break out of an enclosing loop, >and the "multi-case" capability is still maintained. I still want to be able to do: switch ( var ) { case '1': func1(); case '2': func2(); default: func3(); break; } Sm -- Scott Merrilees, BHP Rod & Bar Products Division, Newcastle, Australia INTERNET: Sm@bhpese.oz.au UUCP: ...!uunet!bhpese.oz!Sm