Should reduce take range as first argument?

monarch_dodra monarchdodra at gmail.com
Thu Oct 11 05:10:08 PDT 2012


On Thursday, 11 October 2012 at 11:17:51 UTC, bearophile wrote:
> monarch_dodra:
>
>> Well, I went and implemented the option of doing it Range 
>> first, then Seed, so that UFCS works.
>
> To reduce deprecation troubles there is a Bugzilla suggestion 
> to call it fold():
> http://d.puremagic.com/issues/show_bug.cgi?id=8755
>
> Bye,
> bearophile

Hum...

I can go either way. Both have their ups and downs.

*fold:
**No ambiguity during a migration
**No ambiguity regarding argument ordering
**Duplicates function names
**Changes a (relatively) established function name.
**Higher code impact if we deprecate reduce

*reduce
**Will create some ambiguity, as both reduce(r,s) and reduce(s, 
r) will be valid.
**Will only impact reduce with seed if we deprecate the old 
ordering.

I wouldn't mind getting a nudge in the right direction if anybody 
has a stance on this (Andrei?)


More information about the Digitalmars-d mailing list