proposal: short => rewrite for function declarations

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Oct 10 18:53:08 UTC 2020


On Saturday, 10 October 2020 at 16:38:56 UTC, Sebastiaan Koppe 
wrote:
> Obvious addition, don't understand much of the resistance. My 
> experience is that a lot of languages use => similarly.

I assume that TypeScript and Dart allows "=> expr" as a shortcut 
for "{return expr;}" on method bodies. So some programmers might 
expect it, yes.

Having many ways to express methods make code harder to read IMO, 
but if is in the language already then it makes sense to make it 
a proper shortcut and not a special case.




More information about the Digitalmars-d mailing list