preparing for named arguments

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Aug 27 07:35:32 UTC 2019


On Tuesday, August 27, 2019 1:09:44 AM MDT aliak via Digitalmars-d wrote:
> On Monday, 26 August 2019 at 23:46:51 UTC, Jonathan M Davis wrote:
> > This is exactly one of the reasons why I think that named
> > arguments are a terrible idea. Now, we get to bikeshed about
> > what the "official" name is that we should be naming all of
> > these range parameters in order to be consistent and how we
> > should deal with naming them when there are multiple range
> > arguments. None of this mattered previously. As long as the
> > name was reasonable, it was irrelevant, and even then, it
> > really only mattered for documentation purposes and for making
> > the function internals reasonable to maintain.
>
> Yes I understand you don't want named parameters :) I think the
> benefits far outweigh this negative (plus I agree with rikki).
> But if they do go in without opt-in, then my question still
> stands?

If we don't end up with named arguments in the language, then renaming the
parameters in Phobos is a waste of time and resources - not to mention a lot
of pointless bikeshedding over what the names should be. If we do get named
parameters, the DIP will almost certainly be accepted before anyone
implements the feature (potentially way before anyone implements it, since
DIPs that aren't implemented by the person proposing them tend to not be
implemented particularly quickly), so we can worry about renaming stuff
then.

- Jonathan M Davis





More information about the Digitalmars-d mailing list