std.xml should just go

bearophile bearophileHUGS at lycos.com
Sat Feb 12 06:17:55 PST 2011


Jonathan M Davis:

> It's a problem of semantics. ~ is intended for eager concatenation. That's how 
> it's designed and what it's expected to mean.

This is written nowhere. I am referring to my second proposal. It makes code more generic, because it allows you to use ~ for both arrays and lazy iterables in a polymorphic situation, and the computational complexity here is not a problem. I'd like to know Andrei opinion on this :-)


> More importantly, that's how it 
> works for arrays. If you made it lower to chain, then either ~ for arrays has 
> become lazy (along with every other user-defined type which overloads 
> opBinary!"~" and made it eager as would be expected),

I agree, that's why I have prosed a second alternative that lacks this problem (it doesn't use lowering, just operator overloading and a mixin).


> Regardless, as it's not going to be implemented any time soon, there's not much 
> point in debating it right now.

My second suggestion is related for Phobos only, and it's implementable now, if there's enough desire.

Bye,
bearophile


More information about the Digitalmars-d mailing list