RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Tue Sep 9 21:08:34 PDT 2008


On Wed, Sep 10, 2008 at 12:46 PM, Manfred_Nowak <svv1999 at hotmail.com> wrote:
> Dejan Lekic wrote:
>
>> r.fromBegin(s) is really s.toEnd(r)
>
> Might be true only, if `s' equals `r'.
>
> Otherwise at least one seems to be undefined, because not both can be
> true subranges of each other.
>
> I used the conjunctive form, because a formal definition of "subrange"
> is missing. Such is needed because in a cyclic model `s' and `r' might
> be equal, but not identical, because they contain a whole cycle, but
> their start points differ.

So I think you can put that in other words by saying that they could
mean different things if there's more to a range's state than just a
beginning indicator and an end indicator.

For instance in your example it would be like putting a "#of cycles"
member in the range itself as a third element, rather than associating
it with the end marker.

Interesting.  I suppose that sort of thing is possible, but maybe such
possibilities are annoying enough that they should be made illegal.
In your example it seems simple enough to make the cycle count a
property associated with the "end", and then the difference goes away.

--bb


More information about the Digitalmars-d-announce mailing list