Range Type

Craig Black cblack at ara.com
Mon Mar 24 12:18:14 PDT 2008


"Janice Caron" <caron800 at googlemail.com> wrote in message 
news:mailman.209.1206385654.2351.digitalmars-d at puremagic.com...
> On 24/03/2008, Craig Black <cblack at ara.com> wrote:
>> int..[]
>
> I think I'd be happy with Range!(int)
>
>
>>  To clarify my opinion, I don't see a point in specifying the second 
>> type.
>
> ...unless of course the second type is different from the first type!
> :) Rare though that case may be, I think we'd need it in order to
> retain the existing functionality of opSlice(T,U).
>
> Also, Range!(T,U)[] is unambiguous, wheras T..U[] ...?

I still think we don't need that second type.  We are talking about D 2.0, 
so backwards.compatibility is less of an issue.  Unless there's a compelling 
reason for it, it should be opSlice(T, T).  I think this makes more sense, 
and simplifies the syntax.

-Craig 





More information about the Digitalmars-d mailing list