proposal: short => rewrite for function declarations

Mike Parker aldacron at gmail.com
Sat Oct 10 13:05:48 UTC 2020


On Saturday, 10 October 2020 at 12:30:24 UTC, Imperatorn wrote:

>>
>> @property x() => _x;
>>
>> vs
>>
>> @property x() { return -x; }
>>
>> cause the important thing to me is that my code is simple, 
>> readable, expressive, i dont care about saving 7 chars on a 
>> one liner.
>
> What do you mean. It removes stuff. I'd say Adam's proposal is 
> more readable.

Not to me. Taking away the braces and the return statement turns 
it into a foreign language.


More information about the Digitalmars-d mailing list