Anonymous function syntax

Jesse Phillips jessekphillips+D at gmail.com
Thu Sep 22 10:03:17 PDT 2011


Jacob Carlborg Wrote:

> * Inferred parameter types
> * Automatically return the last expression
> * No need for ending with a semicolon
> * One line lambdas can omit the braces
> 
> Note that Scala can infer the parameter types.
> 
> An additional question, do we want/need a new syntax for declaring 
> lambda/delegate types?
> 
> -- 
> /Jacob Carlborg

The only issue I have with current syntax is return. The type inferring is a bug so...

I've really enjoyed the current syntax options. I've used

auto var = { /// function thing
    return asuth; }()

for a more complex ?:


More information about the Digitalmars-d mailing list