std.xml should just go
bearophile
bearophileHUGS at lycos.com
Sat Feb 12 03:08:15 PST 2011
Jonathan M Davis:
> Except that then you get the issue of eager vs lazy concatenation. chain is lazy
> whereas ~ is eager, so that wouldn't fly.
In dlibs1 I have a lazy chain(). If you perform a chain(chain(x, y), z) or chain(x, chain(y, z)) it's rewritten as chain(x,y,z). Plus there's a "chainable" mixin. If you mix it into a struct or class, the struct or class defines the ~ and ~= operators, making them mean chain(). All this requires no changed in the compiler front-end, and I think it doesn't have the problem you mention.
Bye,
bearophile
More information about the Digitalmars-d
mailing list