DIP 1019--Named Arguments Lite--Final Review

Yuxuan Shui yshuiv7 at gmail.com
Fri Aug 23 23:41:21 UTC 2019


On Friday, 23 August 2019 at 16:47:14 UTC, H. S. Teoh wrote:
> On Fri, Aug 23, 2019 at 04:19:51PM +0000, Dennis via 
> Digitalmars-d wrote:
>> > [...]
>
> Exactly the same objections I have against this DIP.  OT1H it's 
> trying to get named arguments into the language, but OTOH it 
> takes out what I would consider to be two of the most important 
> reasons to *have* named arguments: skipping default parameters, 
> and out-of-order argument passing.  Therefore, it essentially 
> nullifies its own raison d'etre.

It DOES NOT prevent them from being added later. Like I have 
already reiterated multiple times, this is not the be-all and 
end-all named arguments DIP.

>
>
>> [...]
> [...]
>
> [...]
>
> Furthermore, if this DIP hadn't shot itself in its own foot by 
> not allowing out-of-order argument passing and skipping default 
> parameters, then it would have actually made overly-long 
> parameter lists actually *acceptable*, in the sense that the 
> function could just supply default values for most of the 
> parameters, and the caller can just name and pass the few 
> arguments that it wants to be different from the defaults, and 
> the rest don't have to be explicitly specified.

It does not always make sense to supply default values for 
parameters.

e.g createWindow(int width, int height)

What default value do you give them?

>
>
> T



More information about the Digitalmars-d mailing list