proposal: short => rewrite for function declarations

claptrap clap at trap.com
Sat Oct 10 14:25:48 UTC 2020


On Saturday, 10 October 2020 at 12:30:24 UTC, Imperatorn wrote:
> On Saturday, 10 October 2020 at 10:18:15 UTC, claptrap wrote:
>> On Friday, 9 October 2020 at 14:44:25 UTC, Adam D. Ruppe wrote:
>>> [...]
>>
>> From the recent discussions I got the impression that needless 
>> syntax sugar shouldn't be added any more. To get new features 
>> in it needs to be something that cant be done with existing 
>> language features, or it needs to fix something.
>>
>> So doesn't this just add more "stuff" for no meaningful 
>> benefit?
>>
>> I couldnt care less about
>>
>> @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.

How quickly you can visually parse either of them is probably 99% 
down to what your used to. And even then the difference will be 
minuscule. So it's completely irrelevant imo.











More information about the Digitalmars-d mailing list