"fold": a replacement for "reduce"

Meta jared771 at gmail.com
Thu Mar 27 09:35:48 PDT 2014


On Thursday, 27 March 2014 at 16:33:53 UTC, monarch_dodra wrote:
> Also yes, but the general feeling around here, is that "string 
> functions" are a thing of the past, and should be replaced by 
> "real" lambda functions.
>
> As such, even if "naryFun" works, it promotes the use of 
> something that is unpopular, and that some would like to see 
> disappear.

Don't forget this use case:

//Error
alias fun = (a) => a + 1;

//Ok
alias fun = unaryFun!(a => a + 1);

This is the main reason I think naryFun is a good idea.


More information about the Digitalmars-d mailing list