Path: utzoo!mnetor!uunet!husc6!m2c!ulowell!bbn!diamond.bbn.com!mlandau From: mlandau@bbn.com (Matt Landau) Newsgroups: comp.lang.c Subject: Re: The D Programming Language: cases Message-ID: <10700@jade.BBN.COM> Date: 3 Mar 88 01:49:12 GMT References: <222965b9@ralf.home> <2403@umd5.umd.edu> Reply-To: mlandau@bbn.com (Matt Landau) Organization: BBN Laboratories Incorporated, Cambridge, MA Lines: 23 In comp.lang.c (<2403@umd5.umd.edu>), chris@trantor.umd.edu (Chris Torek) writes: >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 */ And of course we add ranges, giving switch(e) { case [1, 2, 3..7, 13, 19, 23..36]: . . . default: . . . } /* what he said */