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

jmh530 john.michael.hall at gmail.com
Fri Feb 7 20:49:05 UTC 2020


On Friday, 7 February 2020 at 20:02:18 UTC, Walter Bright wrote:
> [snip]
>
> So,
>
>     void foo(int a, ...);
>
> called with:
>
>     foo(b:1, 2)
>
> should be the equivalent of:
>
>     foo(2, 1)
>
> ?

This was on the feedback thread, but I didn't want to pollute 
that...

This reminds me of what **kwargs in Python is trying to address. 
Basically, the identifier b is dropped.

For instance,
foo(c:3, b:1, 2)
would be equivalent to
foo(2, 3, 1)
under the DIP and the information that you might have wanted to 
use to make it actually
foo(2, 1, 3)
is no longer available.


More information about the Digitalmars-d mailing list