Revised RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Fri Sep 12 08:40:33 PDT 2008


On Fri, Sep 12, 2008 at 11:58 PM, Sergey Gromov <snake.scaly at gmail.com> wrote:
>>
>> So basically you changed
>> done ==> empty
>> head ==> tip
>> retreat ==> prev
>> ?
>
> The insight was about get/put ==> next.  That's the most significant
> change, others are merely renames as you rightfully point out.  Hence
> the "prev" which should mean both "get at the end" and "put to the end".

Ah ok.  Your switching to declaration syntax instead of usage syntax
confused me. :-)

That is cute.  So
   r.put(e) ==> r.next = e
It would also mean the copy to output idiom would become

for(; ! i.done; i.next)
   o.next = i.head;

Would be cooler if it could be just while(!i.done) o.next = i.next;
.. oh well.

But maybe it's too cute for too little gain?  It's pretty darn obvious
what a "put" function is for.  you can also search for it more easily
then a bunch of next's that could be either writes or not writes.

--bb


More information about the Digitalmars-d-announce mailing list