Discussion Thread: DIP 1030--Named Arguments--Final Review

Gregory g.thompson.1892 at gmall.com
Tue May 12 13:08:52 UTC 2020


On Tuesday, 12 May 2020 at 12:40:47 UTC, Paulo Pinto wrote:
> On Tuesday, 12 May 2020 at 12:11:11 UTC, Gregory wrote:
>> On Tuesday, 12 May 2020 at 05:36:11 UTC, Walter Bright wrote:
>>> On 5/11/2020 5:48 AM, Steven Schveighoffer wrote:
>>>> The biggest problem I had with this DIP still remains -- You 
>>>> cannot forward the "namedness" of parameters to a subtype.
>>>
>>> I see this as something you can propose as another DIP to 
>>> enhance DIP1030 after it is incorporated.
>>
>> It's a feature that would be lost, I don't think named 
>> arguments should be included without this feature. Without 
>> ironing out the details now, who's to say that a suitable 
>> solution exists to the problem? There's no obvious solution to 
>> a problem that should be solved.
>>
>>
>> I also don't like that you can rearrange the arguments into a 
>> different order. Especially that you can put default arguments 
>> in the middle. By doing so you are forcing users to use named 
>> arguments or not use defaults at all. As an example, in C# 
>> only allows defaults at the end, and named arguments still 
>> need to be in the correct order. I don't see *any* benefit, 
>> nor does the DIP describe what benefit this provides. On the 
>> other hand this makes it more difficult to read, especially 
>> (as with the example) both functions have the same exact names 
>> for their parameters. THIS is a feature that should be 
>> removed, and if it is deemed necessary at a later date then it 
>> can be incorporated with another DIP. Otherwise trying to fix 
>> this later on when it is already in use will be almost 
>> impossible without breaking any code that uses it.
>
> That is no longer the case as of C# 8, the rules have been made 
> more flexible.

Link? It was relaxed in C# 7.2 but I don't see anything for C# 8 
that relaxes them further. But it didn't change the requirement 
for defaults or positioning.


More information about the Digitalmars-d mailing list