Lambda are capricious little animals indeed

Maurice m-ou.se at m-ou.se
Sun Oct 27 07:10:49 PDT 2013


On Sunday, 27 October 2013 at 14:01:31 UTC, Derix wrote:
> So, I wanted to wrap my head a little tighter around those 
> strange animals that are lamdas.
>
> I wrote the simpliest program utilizing a lambda :
>
> import std.stdio;
> void main(){
> 	writeln({return "foobar";});
> }
>

You still have to call the lambda just like a function, with ():

import std.stdio;
void main() {
	writeln({return "foobar";}());
}


More information about the Digitalmars-d-learn mailing list