DIP 1030--Named Arguments--Community Review Round 1 Feedback
Walter Bright
newshound2 at digitalmars.com
Mon Feb 10 06:02:02 UTC 2020
On 2/8/2020 9:09 PM, Arine wrote:
> In the D spec it's stated arguments are evaluated from left to right. I know DMD
> doesn't follow the spec (but LDC2 does). It needs to be outlined how arguments
> are evaluated. What makes sense at the call site, or based on the function
> order. As arguments can be passed out of order now.
>
> __gshared int i = 0;
> void foo(int a = ++i, int b = ++i, int c = ++i, int d = ++i, int e = ++i) {
> writeln(a, " ", b, " ", c, " ", d, " ", e);
> }
>
>
> foo(d: ++i, b: ++i); // what does this print?
It says in the DIP that arguments are evaluated left to right as presented.
> How does this work with forward declaring?
D doesn't have forward declarations.
More information about the Digitalmars-d
mailing list