Named Arguments Status Update - Overloading by name

Uranuz neuranuz at gmail.com
Tue Apr 9 21:15:59 UTC 2024


On Tuesday, 9 April 2024 at 20:52:48 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 10/04/2024 8:49 AM, Uranuz wrote:
>> Hello! I have a question. Why you decided to use ":" symbol as 
>> separator of name and value of parameter in function call 
>> syntax? For aestetical reason "=" looks better (at my 
>> opinion). f(x=2, y=10) Maybe this is because I have Python 
>> background where "=" is used for this? ;-)
>
> It is already used for AssignExp which is also a valid argument.
>
> Whereas : is used with struct initializer syntax so has a 
> comparable use case in both D and the C family.

I was thinking that assignment could be the reason, because 
assigment could have some return value.


More information about the Digitalmars-d mailing list