Discussion Thread: DIP 1043--Shortened Method Syntax--Community Review Round 1

max haughton maxhaton at gmail.com
Fri Feb 4 17:51:18 UTC 2022


On Friday, 4 February 2022 at 14:46:39 UTC, Paul Backus wrote:
> On Friday, 4 February 2022 at 12:40:32 UTC, max haughton wrote:
>> On Friday, 4 February 2022 at 11:21:48 UTC, Elronnd wrote:
>>> [...]
>>
>> The implementation as done by Adam is done in the parser but 
>> if I move it down the stack a bit this is probably doable.
>
> Please don't. Having `=> expr` be simple syntax sugar for `{ 
> return expr; }` is consistent and easy to understand. We don't 
> need to add special cases just to save a *single character*:
>
>     this(string y) => this(0, y);
>     this(string y) { this(0, y); }

I am going to move it down the stack for implementation reasons 
(syntax reproduction and error messages) anyway but point taken.


More information about the Digitalmars-d mailing list