DIP 1019--Named Arguments Lite--Community Review Round 1

David Bennett davidbennett at bravevision.com
Thu Mar 21 20:31:57 UTC 2019


On Sunday, 17 February 2019 at 21:04:23 UTC, Yuxuan Shui wrote:
> After thinking about the feedback so far, I currently plan to 
> make these changes to this DIP:
>
> ...

Would you also be able to confirm how this DIP handles default 
arguments and templates?
I think the DIP could use an example showing this off.

One of my almost dally 'is there no better way?' moments with D 
currently is default template arguments, for example to change 
throwErrors currently I need to do:

---

T toString(T=string, bool SomeThing=true, bool throwErrors=true, 
S)(S value){return "";}

auto foo = 123.toString!(string, true, false);

---

Where as I think something like this would be better:

---

auto foo = 123.toString!(throwErrors: false);

---


More information about the Digitalmars-d mailing list