From docs:
The following part => AssignExpression is rewritten to FunctionLiteralBody:
{ return AssignExpression ; }

So, I wonder what happens when curly braces already in place?

Consider this example:
```
import std.algorithm;
import std.stdio;

void main() {
    [1,2,3,4,5]
        .each!(a => { // remove `=>` and you'll get output
            writeln(a);
        });
}
```

This code compiles and doesn't output anything. Which is very counterintuitive for me, because my main experience with lambdas was in C#. Where it's perfectly fine to write `identifiers => { /* some code */ }`.

Reply via email to