Path: utzoo!attcan!uunet!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: The Sins of K&R Message-ID: <12221@crdgw1.crd.ge.com> Date: 27 Sep 90 18:53:53 GMT References: <31604@nigel.ee.udel.edu> <12180@crdgw1.crd.ge.com> <2487@lectroid.sw.stratus.com> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Lines: 49 In article <2487@lectroid.sw.stratus.com>, jmann@angmar.sw.stratus.com (Jim Mann) writes: |>This still doesn't do everything you might want. It doesn't handle |>the situation in which you do something for one case and then |>fall through to the next to do some additional stuff: |> |>switch(ch) |> { |> case 'a': |> do_a(); |> case 'b': |> do_a_or_b(); |> break; |> . |> . |> . |> } Ok, how about requiring the programmer to make it explicit when he/she wants it to fall through, rather than making that the default? Like so: switch(ch) { case 'a': do_a(); continue; case 'b': do_a_or_b(); } or perhaps allow matching more than one case: switch(ch) { case 'a': do_a(); case 'a','b': do_a_or_b(); } This probably belongs in alt.lang.cfutures... |> |>Jim Mann |>Stratus Computer |>jmann@es.stratus.com ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com