"fold": a replacement for "reduce"

monarch_dodra monarchdodra at gmail.com
Thu Mar 27 04:26:36 PDT 2014


On Thursday, 27 March 2014 at 10:42:56 UTC, Marc Schütz wrote:
> I'm not sure I understand this right, but are you or Monarch
> proposing to disallow calling it with an empty range? I believe
> this would be really bad, especially for generic code.
> Folding/reducing an empty range should just return the seed
> value, not be an error.

We are talking about the case when there *is* no seed. What 
should this do?

//----
int[] arr;
reduce!max(arr);
//----


More information about the Digitalmars-d mailing list