DIP 1030--Named Arguments--Community Review Round 1 Discussion

Jon Degenhardt jond at noreply.com
Sun Feb 9 01:47:35 UTC 2020


On Sunday, 9 February 2020 at 01:07:03 UTC, Adam D. Ruppe wrote:
> On Sunday, 9 February 2020 at 00:56:15 UTC, Jon Degenhardt 
> wrote:
>> (Specifically, that a parameter name cannot be changed without 
>> risk of breaking existing callers.)
>
> Does it change your view at all that parameter names are 
> *already public* per both spec and reality and have been for a 
> long, long time? (my web.d framework used their availability as 
> early as 2012ish)
>
> See item #6 here: 
> https://dlang.org/spec/expression.html#IsExpression
>
> "the parameter sequence of a function, delegate, or function 
> pointer. This includes the parameter types, names, and default 
> values."
>
> And, of course, documentation though that isn't strictly part 
> of the compiler breakage.

Probably not, but let me give some thoughts and ask a clarifying 
question.

Main thing - As a pragmatic matter, I'd expect it to be much more 
likely that named argument invocation would be a source of 
breakage than usage arising from introspection.

Related - There is significant difference between parameter names 
being public and having the names be sources of backward 
compatibility in function calls.

Now my question - I know function parameters names can be 
retrieved by type introspection. What I don't know is the ways 
those names can be used such that programs can break if a 
parameter names change. Can you give some examples?


More information about the Digitalmars-d mailing list