RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Sep 9 16:13:08 PDT 2008


Derek Parnell wrote:
> On Tue, 09 Sep 2008 10:30:58 -0500, Andrei Alexandrescu wrote:
> 
> 
>> I'd like to go with:
>>
>> r.first
>> r.last
>> r.next
>> r.pop
> 
> LOL ... I was just thinking to myself ... "what's wrong with First and
> Last? I should suggest them." then I read this post.
> 
> "next" is fine, but "pop"? Isn't the pair of "next" called "prev(ious)" and
> the pair of "pop" called "push". So please, either have next/prev or
> push/pop, and in that case push/pop looks quite silly.

Previous is confusing as it suggest I'm moving back where I came from. 
In reality I shrink the range from the other end. So we need:

"Shrink the range from the left end"
"Shrink the range from the right end"

The first will be used much more often than the second.


Andrei


More information about the Digitalmars-d-announce mailing list