Name Parameter in D
macasm
jckj33 at gmail.com
Sat Apr 18 15:46:27 UTC 2026
On Tuesday, 14 April 2026 at 16:26:04 UTC, Kapendev wrote:
> On Tuesday, 14 April 2026 at 15:34:49 UTC, Greatsam4sure wrote:
>> I just want to ask if named parameter is now in D. I read last
>> of a DIP on named parameter
>
> Yes!
>
> ```d
> int goo(int a = 1, int b = 2) {
> return a - b;
> }
>
> int gaa(int a = 1, int b = 2) {
> return a + b;
> }
>
> int go() {
> return
> goo(b: 1, a: 2) +
> goo(a: 3, 4) +
> gaa(-5, 6) +
> gaa(6, 6);
> }
> ```
pretty nice to have
More information about the Digitalmars-d-learn
mailing list