Revised RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Sep 12 07:59:27 PDT 2008


Bill Baxter wrote:
> On Fri, Sep 12, 2008 at 11:22 PM, Sergey Gromov <snake.scaly at gmail.com> wrote:
> I'm actually ok with either "done" or "empty".  "Done" is weird on a
> random access range, but "empty" is weird on file input range, or a
> generator.  Or on the HMM example which is "done" when it reaches an
> end state, but is not really "empty".

That's exactly right. "Empty" is a state, and "done", while also a 
state, also evokes process. I found it very nice to write stream ranges 
that become "done" after some point. "Empty" was less clear because it 
suggested e.g. the underlying file is empty.

On the other hand it's odd to receive a fresh new range and ask yourself 
whether it's "done".

As I wrote Walter and Bartosz a while ago, this all reminds me of a 
funny dialog in Alice in Wonderland 
(http://www.cs.indiana.edu/metastuff/wonder/ch7.html):

`Take some more tea,' the March Hare said to Alice, very earnestly.

`I've had nothing yet,' Alice replied in an offended tone, `so I can't 
take more.'

`You mean you can't take LESS,' said the Hatter: `it's very easy to take 
MORE than nothing.'

> "head to toe" is a perfectly common expression, at least in American
> English.  Not sure why you don't like it.  But tip to toe is kinda
> cool for being 1 less letter!  And no less clear.

I like "tip" too. And as Pablo said, it's less anthropocentric than 
head+toe.

You know what's the name of Sergey's empty range that lies right at the 
end of a range? Toenail! :o)

> "prev" is horrible.  I still like "retreat" best so far.  We need the
> contrapositive of "next" not the "opposite".  :-)  And since that
> doesn't exist we should just go for a word that sorta means the right
> thing and won't be  confused with being the opposite (or with being
> something else entirely like "reduce").

Retreat is a great word. I replaced reduce with it. That was easy 
because this time I had the foresight of defining ddoc macros for all 
primitive names :o). Thanks!


Andrei



More information about the Digitalmars-d-announce mailing list