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

Steven Schveighoffer schveiguy at gmail.com
Wed May 13 20:42:32 UTC 2020


On 5/13/20 3:44 PM, Jonathan Marler wrote:

> I found a way:
> 
> void copy(string, string destination)
> {
>      alias source = _param_0;
> }
> 
> I didn't realize you could do this till now but this allows functions to 
> "opt-out" of using named parameters.  We may want to consider using this 
> pattern throughout phobos/druntime when we want want to prevent 
> parameter names from being apart of the API.
> 

That is an implementation detail, and not a spec feature.

It would have to be properly defined for it to be a sufficient workaround.

Also, there is no guarantee that with this DIP:

copy(_param_0: "foo", destination: "bar")

doesn't work. There would have to be.

-Steve


More information about the Digitalmars-d mailing list