Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!brl-adm!umd5!trantor.umd.edu!chris From: chris@trantor.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: The D Programming Language: cases Message-ID: <2403@umd5.umd.edu> Date: 2 Mar 88 22:22:57 GMT References: <222965b9@ralf.home> Sender: ris@umd5.umd.edu Reply-To: chris@trantor.umd.edu (Chris Torek) Organization: University of Maryland, College Park Lines: 24 -In article <24996@cca.CCA.COM> g-rh@cca.CCA.COM (Richard Harter) writes: -}As a side point, I like the suggestion that someone made that there be -}a fallthrough statement rather than automatic fallthrough. In article <222965b9@ralf.home> Ralf.Brown@B.GP.CS.CMU.EDU writes: -So, you would like to have to write - switch(var) - { - case foo: fallthrough; - case bar: fallthrough; - case baz: fallthrough; - case mung: /* code to do something for all four cases */ - } While this would work, if we assume D has aggregate constructors, there is a handsomer way: switch (e) { case [1, 2, 3, 5, 7, 13, 19, 23]: ... } /* syntax above is only for demonstration */ -- In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163 (still on trantor.umd.edu because mimsy is not yet re-news-networked) Domain: chris@mimsy.umd.edu Path: ...!uunet!mimsy!chris