Case Range Statement ..

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Tue Jul 7 01:44:24 PDT 2009


Mike James wrote:
> Tim Matthews Wrote:
> 
>> The case range statement is currently this
>>
>> case FirstExp : .. case LastExp :
>>
>> Would it be ambiguous to the compiler if it was
>>
>> case FirstExp .. case LastExp :
>>
>> or even
>>
>> case FirstExp .. LastExp :
>>
>>
>> Considering that we can correctly identify a slice rather than decimal 
>> by just giving it a priority:
>>
>> a = b[3..6];
> 
> 
> Or you introduce a new keyword :-)
> 
> switch (var) {
>     case 0:
>         break;
> 
>     case 1 to 5:
>         break;
> }
> 
> 
> -=mike=-


Introducing "to" as a keyword would break the std.conv module, which 
would be a shame. It's a very nice module.

-Lars



More information about the Digitalmars-d mailing list