Switch: Case Range Syntax

bearophile bearophileHUGS at lycos.com
Wed Aug 17 11:24:21 PDT 2011


Vijay Nayar:

> Thanks for the post!  This kind of history is pretty fascinating and I'll 
> give it a good read.  From what I've read so far, I'm surprised at how 
> heated the debate becomes :)

The current syntax is a compromise of several different needs, and it's acceptable, despite a minor fault (it reminds a bit too much the slice syntax, despite including the final item. The final item is included because it is more handy for char ranges: you are allowed to write case 'a': .. case 'z': to take all lowercase ASCII).

I'd like some support for final switches on integers, and to use range case syntax in final switches too.

Bye,
bearophile


More information about the Digitalmars-d mailing list