Problem about lambda expressions

Tongzhou Li zhangsongcui at hotmail.com
Wed Mar 28 04:13:47 PDT 2012


On Wednesday, 28 March 2012 at 10:17:15 UTC, Timon Gehr wrote:
> On 03/28/2012 10:28 AM, Tongzhou Li wrote:
>> On Wednesday, 28 March 2012 at 08:22:25 UTC, Tongzhou Li wrote:
>>> I understood. But why it compiles instead of giving an error? 
>>> What
>>> does the complier do when I write the wrong code?
>>
>> Oh, I mean if I write the wrong code, what objectcode does the 
>> compiler
>> generate?
>> My English is not good, sorry.
>
> (int a) => {return a;}
>
> Is the same thing as
>
> (int a){return ()=>a;}

I understand.
   { return a; }
is a function which requires no params right?


More information about the Digitalmars-d-learn mailing list