DIP 1030--Named Arguments--Community Review Round 1 Discussion
Steven Schveighoffer
schveiguy at gmail.com
Tue Feb 11 13:52:35 UTC 2020
> On 2/10/2020 1:02 PM, Manu wrote:
>> Named arguments breaks this very important pattern:
>
> Named arguments will not match to ... parameters, so it won't break existing code, it just won't compile if you write new code that tries that.
Just wanted to point out without muddying the feedback thread, that this
response completely misses the point.
The point is to have a wrapper for origFun which behaves exactly as the
original function, but does something special inside.
Saying you won't be able to call wrapper with named parameters is the
actual point of the post. It would be good to have a response to the
fact that it breaks the intention of perfect forwarding.
An example:
foo(a: 1, b:2);
Now I want to replace all calls to foo with a special wrapper that logs
all calls.
alias foo = logCalls!(.foo);
foo(a: 1, b:2); // error, cannot use named parameters with tuples.
Is there a plan to mitigate this limitation?
-Steve
More information about the Digitalmars-d
mailing list