"Michel Fortin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2008-11-21 07:43:47 -0500, bearophile <[EMAIL PROTECTED]> said: > >> Just found this cute article on Reddit: "GCC hacks in the Linux kernel", >> by M. Tim Jones: >> http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/index.html >> >> Here are few comparisons between those featuers are D ones. >> >> The range syntax that can be used in switch statements and array >> defintions is cute: >> 1 ... 7 >> D2 already has a range syntax, it just needs to be extended for other >> purposes (and adding a stride too may be useful, but it's less >> important). > > I've wanted that range thing in switch statements some time ago while > writing a parser working with character ranges. >
I've been wanting the ability to use "partial" and multiple boolean expressions in a case. In which case (no pun intended), case 5..20: would be a special-case (boy, I can't avoid the unintentional puns, can I?) syntactic sugar for the more generalized syntax of: case >=5, <20: