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

Steven Schveighoffer schveiguy at gmail.com
Thu May 14 19:55:02 UTC 2020


On 5/12/20 2:22 AM, Jonathan Marler wrote:
> 
> I'd really like to see the DIP include a proposal on parameter naming 
> conventions for the standard libraries before we enable this.
> 

[snip]

> 3. ...

Another convention could be -- if a parameter starts with underscore, 
then the expectation is that you don't use named parameters with that 
argument. Such parameter names should always come first, and are subject 
to the parameter name changing without considering it to break code.

If you use _xyz as a named parameter, and the name changes to _abc, 
that's your fault.

Just an idea, in the event that we cannot find a good way to have the 
compiler prevent named parameter usage.

-Steve


More information about the Digitalmars-d mailing list