Case Range Statement ..

Robert Clipsham robert at octarineparrot.com
Tue Jul 7 05:12:21 PDT 2009


Daniel Keep wrote:
> Andrei Alexandrescu wrote:
>> I swear if I didn't know anything about the feature and saw the syntax
>> "case a: .. case b:" I'd know exactly what it does in a millisecond. Why
>> would the syntax seem inconsistent to new D users? First of all,
>> inconsistent with what? And how would you treat the issue differently?
>>
>>
>> Andrei
> 
> I think something that might help is if you started using the syntax
> like this:
> 
>> case a:
>> ..
>> case b:
>>     blah
> 
> Now it's clear that it represents a sequence of case labels where all
> but the first and last have been elided VERSUS representing a case label
> where the label is a range.
> 
> I get the sneaking suspicion that the major problem people have with the
> syntax is that when you write "case a: .. case b:" all on one line, they
> treat it as the latter when they should be thinking in terms of the
> former; the various suggestions that have been made would seem to
> support this.

I've been keeping quiet on the subject to see how it plays out... Now 
I've seen it written like this I'm sold! :D



More information about the Digitalmars-d mailing list