Wouldn't it be nice (case range statements)

eles via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 15 01:05:51 PDT 2014


On Tuesday, 14 October 2014 at 21:29:59 UTC, John Colvin wrote:
> if code like this worked: http://dpaste.dzfl.pl/7ea4eb03f02e
>
> A few reasons why it doesn't:
>
> You have to duplicate the case keyword when declaring case 
> ranges. Why?
>
> Case ranges are inclusive at both ends of the range, unlike in 
> foreach. Again, why?

Actually, the latter is the reason for the former. If incluseve 
ranges were defined (let's say with ...), then that becomes 
possible.


More information about the Digitalmars-d mailing list