Transience of .front in input vs. forward ranges

deadalnix deadalnix at gmail.com
Mon Nov 5 17:51:30 PST 2012


Le 06/11/2012 02:36, Andrei Alexandrescu a écrit :
> On 11/6/12 3:06 AM, H. S. Teoh wrote:
>> I've already given a number of
>> non-trivial examples of transient forward ranges, and apparently
>> deadalnix has also encountered the same issue.
>
> I'd like to build more of this argument. I pointed out that your range
> is actually defining .dup, not .save.

Yes my code can also fall in the .dup stuff.

If we actually make that difference, our case is moot, but a hell lot of 
code is broken as well.

For instance, the way map is defined is highly incorrect as each call to 
.front can pop a newly generated element as well, and I'm pretty that 
isn't the only one.

We are here back to equality vs identity, and it seems D also have some 
stuff to fix in that regard (notably struct and AA). Discussing that 
here only make the problem more confuse and is not helping as long as 
this question is open in D.


More information about the Digitalmars-d mailing list