Nonstandard GCC features

Nick Sabalausky a at a.a
Sat Nov 22 03:25:25 PST 2008


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:gg6ddd$1s09$1 at digitalmars.com...
> On 2008-11-21 07:43:47 -0500, bearophile <bearophileHUGS at lycos.com> 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:





More information about the Digitalmars-d mailing list