"fold": a replacement for "reduce"

Simen Kjærås simen.kjaras at gmail.com
Thu Mar 27 09:42:03 PDT 2014


On 2014-03-27 16:35, Meta wrote:
> 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.

That could very well be argued to be a bug, though.

--
   Simen


More information about the Digitalmars-d mailing list