reduce -> fold?
Luís Marques via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jan 29 06:05:06 PST 2016
On Friday, 29 January 2016 at 13:56:48 UTC, Dragos Carp wrote:
> But not in python, where "accumulate"[1] is the generic
> equivalent of C++ "partial_sum"[2]. I like "fold" more.
>
> BTW this week, a colleague of mine implemented a python
> "accumulate" in D. Is there any interest to contribute it to
> Phobos? How should this be named?
>
> [1]
> https://docs.python.org/3/library/itertools.html#itertools.accumulate
> [2] http://en.cppreference.com/w/cpp/algorithm/partial_sum
Fair enough. Yes, that is indeed a useful algorithm, so please do
contribute. I won't bikeshed on that other name, heh.
More information about the Digitalmars-d
mailing list