We need to rethink remove in std.container

%u wfunction at hotmail.com
Mon Feb 21 21:34:05 PST 2011


> The more I look at it, the more I'm convinced that we really need to
add a primitive to forward ranges that returns the first n elements of
that range. Without that, I don't see how you can get a range of the
correct type with only those elements in it unless it's also a
bidirectional range, which some ranges (like SList's range) aren't.

Huh, yeah I think I agree. It seems like ranges are just delayed
evaluation, and that, at some point, we need to be able to force their
evaluation -- otherwise, it's like combining Scheme's (delay X) and
(force Y) operations with mutation, which just doesn't work sensibly
in non-functional programming.


More information about the Digitalmars-d mailing list