Case Range Statement ..
Ary Borenszweig
ary at esperanto.org.ar
Tue Jul 7 07:50:54 PDT 2009
Jesse Phillips wrote:
> On Tue, 07 Jul 2009 04:35:56 -0400, 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=-
>
> to? really, no, it needs to be -
>
> switch (var) {
> case 0:
> break;
>
> case 1 - 5:
> break;
> }
Is that a joke?
More information about the Digitalmars-d
mailing list