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

Kagamin spam at here.lot
Wed Feb 9 14:07:45 UTC 2022


On Saturday, 5 February 2022 at 16:19:42 UTC, Doigt wrote:
> Except commonly, and to take two popular examples: JavaScript 
> and C#, the arrow notation is not understood to be a shorthand 
> for a return expression but just an expression. I don't think 
> I'll use this new feature if I can't make my code base 
> consistent in style. It makes no sense to me to have things like
> int myFunc (int a) => something;
> void myProc (int a) { something; }
> it looks bad and it makes it seems like void is a special case 
> that is not immediately obvious why the arrow notation is not 
> used.

You can't opt out from the full function syntax: most functions 
can't be shortened, so you end up using both syntaxes.


More information about the Digitalmars-d mailing list