Anonymous function syntax

Walter Bright newshound2 at digitalmars.com
Thu Sep 22 00:34:39 PDT 2011


On 9/21/2011 8:10 PM, Jesse Phillips wrote:
> On Wed, 21 Sep 2011 18:29:34 -0400, bearophile wrote:
>
>> Walter Bright:
>>
>>> D
>>>       (a,b) { return a + b; }
>>
>> In D to define a true lambda you need types too: auto f = (int a,int b){
>> return a + b; };
>
> This is true of C# too and I think is appropriate to mention, though it
> can take the destination type into account when doing inference.

As Andrei pointed out, it is not true of D, since D does not require the types 
for the parameters.


More information about the Digitalmars-d mailing list