Suggestion: array slice through arr[base, size]

Orvid King via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 8 07:23:12 PST 2015


On Sunday, 8 February 2015 at 15:20:17 UTC, karl wrote:
> Hi, it's a bit unwieldy to write/read this:
> result = src[base .. base+size];
> instead of:
> result = src[base, size];
>
> Maybe such syntax would be a welcome addition to D? I don't see 
> it conflicting with the existing grammar, and only the 2 
> slicing-operators need further extending to support it.

No, because that looks like it should be indexing a uniform 
multi-dimensional array, which it very definitely is not.


More information about the Digitalmars-d mailing list