On Saturday, 13 March 2021 at 21:33:20 UTC, Meta wrote:

// these 2 are equivalent
int foo() { return 1; }
int foo() => 1;
The syntax allows the form => expr to replace the function body { return expr; }

Amazing! I had no idea this got in. I love the syntax.

Yeah, c# added this syntax awhile back and is nice to use at times, usually because I stumble on the property syntax.

https://www.google.com/amp/s/csharp.christiannagel.com/2017/01/25/expressionbodiedmembers/amp/

Reply via email to