Transience of .front in input vs. forward ranges
Jonathan M Davis
jmdavisProg at gmx.com
Sun Nov 4 23:49:48 PST 2012
On Sunday, November 04, 2012 20:59:16 H. S. Teoh wrote:
> It lets us add code only where transience matters, which is with things
> like byLine, and a few algorithms that actually care to take advantage
> of transient ranges. Nothing else is affected. It certainly doesn't
> affect "everything" -- if indeed, as you say, transient ranges are rare
> occurrences.
The problem is that every single range-based function in Phobos which could
possibly work with a transient range would have to take such ranges into
account in the ranges that they create. Otherwise, the transience is lost,
making transient absolutely useless. So, it affects a _lot_ more than just
ranges like ByLine and ByChunk, and regardless of how rare such ranges are,
the entirety of Phobos would have to take them into account whenever a wrapper
range is created.
If you don't care about wrapper ranges propagating the transient property when
they can, then there's no point in having it in the first place. You might as
well just use opApply. And if you _do_ care, then it affects everything, even
if base ranges with transient fronts are rare. I don't see how you can
possibly think that this isn't a highly intrusive change to ranges.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list