Proposal: Extension Methods

Nick Sabalausky a at a.a
Sun May 18 11:30:31 PDT 2008


"Dee Girl" <deegirl at noreply.com> wrote in message 
news:g0pfva$1cqb$1 at digitalmars.com...
> Nick Sabalausky Wrote:
>> It would also allow extra paramaters to be specified without having to 
>> turn
>> them into template parameters:
>>
>> int[] a = "file.csv".readText().split(",").map!(to!(int)))();
>
> This is big problem with functional style in D!

Yea, I kinda thought that would cause a problem with functional style. But 
like I said, if you need a functional style, you can still just use pipe! or 
compose!.

> D does not have currying. Unfortunate you can not write split(",") and 
> obtain a new function. Maybe language in future can accept split(_, ",") 
> meaning function that takes one argument and passes to split in first 
> position and "," in second position. Dee Girl

Couldn't you do something like that with templates? It wouldn't be as pretty 
as built-in currying support though. 





More information about the Digitalmars-d mailing list