proposal: short => rewrite for function declarations

Timon Gehr timon.gehr at gmx.ch
Sun Oct 11 19:32:50 UTC 2020


On 11.10.20 21:07, Steven Schveighoffer wrote:
> On 10/11/20 2:59 PM, Timon Gehr wrote:
>> alias x=(t){ return expr; }
>> auto x(t){ return expr; }
>>
>> Not sure what you are trying to achieve by varying the syntax this 
>> way. `=>` or not `=>` has nothing to do with function literal semantics.
> 
> You're right, it's already confusing.
> 
> I guess we can add more confusion as long as it's added consistently.
> 
> -Steve
`auto f(args)=>expr;` being transformed to `auto f(args){ return expr; 
}` is not confusing. Without the new syntax, the second form is what 
would occur in the source code, with identical semantics, confusing or not.

No confusion is added.


More information about the Digitalmars-d mailing list