proposal: short => rewrite for function declarations

James Blachly james.blachly at gmail.com
Fri Oct 9 18:09:38 UTC 2020


On Friday, 9 October 2020 at 14:44:25 UTC, Adam D. Ruppe wrote:
> After a brief chat yesterday, I slapped this together:
>
> https://github.com/dlang/dmd/pull/11833
>
> In short, in a function declaration, it rewrites `=> ...;` into 
> `{ return ...; }`
>

Very much support!

(a limited form of) This is widely used in ECMAscript and called 
"arrow function"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions



More information about the Digitalmars-d mailing list