Revised RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Sun Sep 14 14:28:23 PDT 2008


On Sun, Sep 14, 2008 at 8:55 PM, Michel Fortin
<michel.fortin at michelf.com> wrote:
> On 2008-09-13 12:42:56 -0400, Sergey Gromov <snake.scaly at gmail.com> said:
>
>> A nice pair for .retreat() is .advance().  The words are even of the
>> same length.

My reasoning was that if you pick any pair of antonyms then its going
to suggest that the operation applies to the same thing.  It's the
opposite direction *and* the opposite thing, which is why I compared
it to the "contrapositive" in another message.   I like retreat
because it's the exact opposite of a word that's similar to "next",
but not.  Therefore it doesn't lead you to expect that it manipulates
the same element.

Another way of looking at it is that both ends are actually doing the
same thing -- they're both "advancing" or doing "next".  Just their
notion of next is different.  In that sense you could call it more
like the "converse" operation.  You could use a notation like STL
reverse iterators and have "rhead" and "rnext", (where r is for
"reverse").  I like that in that it recognizes that.  I don't like
using made-up words, though.

> But then, why not .next() and .pull()? They're the same length too. :-)

I thought about pull -- I think I discarded it sounds like you're
pulling something in from somewhere and as a result your range should
become bigger.

--bb


More information about the Digitalmars-d-announce mailing list