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

Jacob Carlborg doob at me.com
Wed May 13 07:55:33 UTC 2020


On 2020-05-11 13:37, Mike Parker wrote:
> This is the discussion thread for the Final Review of DIP 1030, "Named 
> Arguments":
> 
> https://github.com/dlang/DIPs/blob/7d114c93edb02d8fc4b05f0716bdb6057905fec2/DIPs/DIP1030.md 

Regarding renaming parameters will break the API. Swift supports giving 
a different name which are used locally:

func copy(_ source: String, to destination: String)

Should be called like this:

copy("foo", to: "bar")

`_` indicates that the argument can not be named when calling the 
function. `to` is the name that is used when calling the function. 
`source` and `destination` are the names used locally in the 
implementation of the function.

This allows to rename a parameter (the local name) without breaking the API.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list