Case Range Statement ..
Walter Bright
newshound1 at digitalmars.com
Wed Jul 8 20:26:00 PDT 2009
Bill Baxter wrote:
> I think what Jerome is getting at is that we could be getting more
> mileage out of the xpr1..xpr2 syntax. It would be useful syntax for
> more than just integral, dense ranges in foreach and slices. The
> equivalents I've used or seen in Ruby, Python and Matlab are more
> versatile than D's. Perhaps that can't be translated in any useful
> way to a static language like D, I dunno. But it leaves one with the
> feeling that D's slice literals are underpowered and that the case
> range thing is just plugging a hole in a dilapidated boat rather than
> building us a nice new sleek yacht.
How are python's so much better?
1. python's ranges are exclusive of the endpoint
2. python doesn't have a switch statement, so case ranges being better
in python makes no sense
More information about the Digitalmars-d
mailing list