Discussion Thread: DIP 1030--Named Arguments--Final Review
12345swordy
alexanderheistermann at gmail.com
Tue May 12 21:03:34 UTC 2020
On Tuesday, 12 May 2020 at 18:57:25 UTC, jmh530 wrote:
> On Monday, 11 May 2020 at 11:37:07 UTC, Mike Parker wrote:
>> [...]
>
> I think the arguments brought on in the previous review with
> respect to the API remain a concern. The feedback notes this
> issue, but in response the DIP author notes that if a parameter
> is not found then it is an error. Of course, this is the whole
> issue. Someone can change
> void foo(int x, int y, int z) {}
> to
> void foo(int x, int a, int b) {}
> and user code that relies on calling foo with keywords for y
> and z will break. I think this also connects with the feedback
> that the feature should be opt-in.
>
> [...]
If the user uses named arguments then that is by definition
opt-in. It makes no sense for the developer to opt-in for named
arguments as well.
I had already made my case regarding the "opt-in" part of the
discussion, by pointing out that c# has named arguments by
default and you can't opt out of it.
-Alex
More information about the Digitalmars-d
mailing list