DIP 1030--Named Arguments--Community Review Round 1 Feedback

Vijay Nayar madric at gmail.com
Thu Feb 6 10:05:12 UTC 2020


On Thursday, 6 February 2020 at 06:09:36 UTC, Mike Parker wrote:
> This is the feedback thread for the first round of Community 
> Review of DIP 1030, "Named Arguments".

Regarding the matching rule No. 2 quoted below:

> Matching of NamedArguments to a function's, function pointer's, 
> or delegate's parameters proceeds in lexical order. For each 
> NamedArgument:
>
>  1. If an Identifier is present, it matches the Parameter with 
> the corresponding Identifier. If it does not match any named 
> Parameter, then it is an error.
>  2. If an Identifier is not present, the Parameter matched is 
> the one following the previous matched Parameter, or the first 
> Parameter if none have yet been matched.

If one is using Uniform Function Call Syntax, the first parameter 
is already filled in with the object to the left of the "." 
symbol.  Does this create a conflict?  For example:

void doStuff(int a, string b, double c) { ... }

3.doStuff(6.7, b: "ham")

In this example, "6.7" is the first argument, it does not have an 
Identifier, but it cannot be matched to the first argument, 
because "3" has already been filled in for that. Or in this 
proposal, do the arguments matched via UFCS count as a "previous 
matched parameter"?


More information about the Digitalmars-d mailing list