DIP 1019--Named Arguments Lite--Final Review

a11e99z black80 at bk.ru
Fri Aug 23 20:06:21 UTC 2019


On Friday, 23 August 2019 at 19:55:31 UTC, Andrei Alexandrescu 
wrote:
> On 8/23/19 3:30 PM, Dennis wrote:
>> On Friday, 23 August 2019 at 18:41:56 UTC, H. S. Teoh wrote:
>
>> E.g. what does this code do:
>> ```
>> import std.stdio;
>> void foo(int a, double b) {writeln("0");}
>> void foo(int b, int a) {writeln("1");}
>> 
>> void main()
>> {
>>      foo(b: 10, 0);
>> }
>> ```
>> 
>> You might have an obvious intuition for this situation ("that 
>> should be an error!"), but maybe there are other ones.
>
> Good point. This is what the DIP review cycle is for.

does rule "named args after unnamed" solve this problem?
foo( b:10, 0 ); // C# ERROR: Named arguments must appear after 
the positional arguments

foo( 0, b:10); // foo( int, int) no doubts



More information about the Digitalmars-d mailing list