Range proposal
Manfred_Nowak
svv1999 at hotmail.com
Wed Sep 10 10:04:09 PDT 2008
Bill Baxter wrote:
> think of a range more as an iterator plus a sentinel
The problem with both models is, that there are canonical operators one
both models, which are somehow frantically hidden. This is shown
1) by the deliberately constructed compound of `[left,right]
[Diff,Union]'
2) the missing definition of a "subrange"
Both seem undefinable without having some notion of "concatenation"---
and if one has concatenation, a request for the reverse operation
"splitting" is unavoidable.
In fact the semantics of `r.moveTo(s)' seems not to be fully defined in
both approaches.
In fact in your approach of thinking of `r.moveto(s)', the "iterator"
of `s' turns into a "sentinel" for `r', thereby making sentinels and
iterators to synonyms.
If there is indeed a structural similarity to Andrei's approach, the
same problem must show up somewhere.
-manfred
--
If life is going to exist in this Universe, then the one thing it
cannot afford to have is a sense of proportion. (Douglas Adams)
More information about the Digitalmars-d
mailing list