Transience of .front in input vs. forward ranges

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Oct 31 10:19:49 PDT 2012


On Wed, Oct 31, 2012 at 02:18:55PM +0100, deadalnix wrote:
> Le 31/10/2012 01:56, H. S. Teoh a écrit :
> >
> >+1. I like this better than my proposal.
> >
> 
> The obvious drawback is that this make invalidating ranges harder to
> write. But they seems to be more the exception than the rule.

Actually, there is another problem: many algorithms' output will be
transient or not depending on the input range. For example, we could
write map to use the transient version of byLine, say, but then the
range that map returns will also be transient (no longer safe).

IOW, transience of .front is transitive in some cases. This again makes
things complicated: as soon as you use a single transient range, it
makes downstream ranges transient as well. So we're back to the problem
of how to mark the range as transient in a transparent way. :-(


T

-- 
VI = Visual Irritation


More information about the Digitalmars-d mailing list