Optional brackets around lambda expression (was: Expected
Bob Foster
bobfoster at gmail.com
Thu Jun 16 13:34:27 PDT 2011
Ali Ebrahimi wrote:
> Hi, how about this one:
>
> process( x -> x + 1 );
> process( x -> { return x + 1; } );
> process( x -> {
> if (x == 0) {
> return 0;
> }
> return x + 1;
> });
Yes, I quite like that.
(I guessed that mail removed some indentation from your example, so I put
some back.)
And the nullary form is:
process( -> 3 );
Bob
More information about the lambda-dev
mailing list