Should reduce take range as first argument?

monarch_dodra monarchdodra at gmail.com
Thu Oct 4 00:19:29 PDT 2012


On Monday, 14 May 2012 at 21:33:19 UTC, Andrei Alexandrescu wrote:
>
> Yah, reduce was not designed for the future benefit of UFCS. (I 
> recall take() was redefined towards that vision, and it was a 
> good move.)
>
> We can actually deprecate the current order and accept both by 
> inserting the appropriate template constraints. We change the 
> documentation and examples to reflect the new order, and we 
> leave a note saying that the old order is deprecated. We can 
> leave the deprecated version in place for a long time. Thoughts?
>
>
> Andrei

[Resurrecting old thread]

I've into somebody else having this issue in .Learn very 
recently. I was *going* to propose this change myself, but 
happened on this thread directly. I think it is a good idea.

Looks like nobody tackled this since. Is it OK if I go ahead and 
implement this?

Just ot be clear, the goal is to support both:
reduce(range, seed) and reduce(seed, range)
Then we make reduce(seed, range) deprecated
Then we remove it.

I'd rather have a green light here, then force the discussion on 
a pull request... :D


More information about the Digitalmars-d mailing list