[Issue 5691] walkLength() compatible with opApply()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 4 07:44:33 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5691



--- Comment #11 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-03-04 07:41:35 PST ---
I agree that opApply has advantages over ranges. I'd also argue it lacks the
level of control that would make it a useful abstraction. If we allow
walkLength to work with isIterable, we really need to review all algorithms to
see if they could also work with isIterable, and possibly adjust a number of
them to use foreach. It's not impossible there might be some forking on static
if (isIterable!...).

Such an effort would be significant and might increase the size and complexity
of std.algorithm. At this point in Phobos' design I think it's worth
acknowledging that we can't accommodate every design in the book and we need to
keep a watchful eye on complexity. (For example I am very seriously thinking of
assuming cheap constructors, which would remove all the moveFront etc.
functions).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list