Breaking ";" rule with lambda functions

ag0aep6g anonymous at example.com
Mon Aug 1 15:08:04 UTC 2022


On Monday, 1 August 2022 at 14:52:03 UTC, pascal111 wrote:
> If `foo => bar` == `(foo) { return bar; }`, then  `foo => bar` 
> is a function. "=>" is not an operator, it's a special symbol 
> for lambda "function".
>
> If A == B, so A's types is the same of B's type. How can it be 
> withstanding `foo => bar` == `foo => bar` == `(foo) { return 
> bar; }` and `foo => bar` is an expression and the other is a 
> function?!! no sense.

`foo => bar` and `(foo) { return bar; }` are both function 
literals, and they're both expressions. The concepts are not 
mutually exclusive.


More information about the Digitalmars-d-learn mailing list