RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Sep 10 07:57:03 PDT 2008


Bill Baxter wrote:
> On Wed, Sep 10, 2008 at 10:07 PM, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>> Bill Baxter wrote:
>>> But I think you and I are in agreement that it would be easier and
>>> more natural to think of ranges as iterators augmented with
>>> information about bounds, as opposed to a contiguous block of things
>>> from A to B.
>> I like that you are bringing this point up, it is interesting. Note that my
>> API never assumes or requires that there's an actual contiguous block of
>> things underneath. Au contraire, in the I/O case, there's only "the current
>> element" underneath.
> 
> Yes, I see that and think it's great.  But the point I've been trying
> to make is that the nomenclature you are using seems to emphasize the
> contiguous block interpretation, rather than the interpretation as a
> cursor plus a sentinel.  The contiguous block terminology makes good
> sense for slices, but less for things like trees and unbounded
> generators and HMMs.

I disagree that isEmpty, first, and next suggest anything near 
contiguous block. It's just list terminology. Is the list empty? Give me 
the first element of the list. Advance to the next element in the list.

Names for the before and after range operations are still in the air...

Are you referring to the "range" name itself?

> And ok, I do think your incredible shrinking bidirectional range is
> borked.  But other than that, I'm just talking about terminology.

How is it borked?


Andrei


More information about the Digitalmars-d-announce mailing list