On Monday, 4 June 2018 at 05:46:04 UTC, rikki cattermole wrote:
On 04/06/2018 5:01 PM, Mike Parker wrote:
Named arguments lite

I'm concerned about this DIP (keep in mind I wrote a referenced WIP DIP).

1. Reordering of parameters that match (with overloads)

```D
int add(int a, int b);
int add(int b, int a) { ... }
```

This part of the DIP needs quite a bit of filling out and I expect to have a lot of corner cases.

Are you saying that you have an add that is extern'd or do you mean a named argument function overload? By conventional wisdom it definitely should error out.

Not sure what you meant? This definitely does not error out: https://godbolt.org/g/PAiFPw


2. All or nothing.

```D
int add(int x, int y);
@named:
int add(int b, int a) { ... }
```

This is one of the reasons some people /don't/ want named arguments and have said that they out right would not use a language with it.


Care to elaborate why? In this DIP, name prefix on caller side is optional, caller is allowed to leave out any number of argument names if they want.

Reply via email to