RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Sep 9 14:56:40 PDT 2008


Andrei Alexandrescu wrote:
> Manfred_Nowak wrote:
>> Benji Smith wrote:
>>
>>> Given the use of "getNext", I think "hasNext" is a more natural
>>> choice 
>>
>> clapping hands.
> 
> Walter would love that.
> 
> for (R r = getR(); r.hasNext; r.next) { ... }
> 
> Look ma, no negation! Oops, I just materialized one with the exclamation 
> sign.

I just discovered a problem with that. hasNext implies I'm supposed to 
call next to get the thingie. It should be hasFirst, which is less 
appealing.

Andrei


More information about the Digitalmars-d-announce mailing list