Will D ever get optional named parameters?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 13 16:09:51 PDT 2014


bachmeier:

> def foo(x: int = 1000, y: double = 0.0): double {}
>
> If you later change the names to something more informative
>
> def foo(reps: int = 1000, variance: double = 0.0): double {}

You can use:

double foo(int deprecated(x) reps=100, deprecated(y) 
variance=0.0) {...}

Bye,
bearophile


More information about the Digitalmars-d mailing list