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

Patrick Schluter Patrick.Schluter at bbox.fr
Sun Jun 9 08:05:43 UTC 2019


On Sunday, 9 June 2019 at 02:49:13 UTC, Jonathan Marler wrote:
> This gets worse when you introduce the concept of 
> order-of-evaluation:
>
> int x = 0;
> foo(x++, c=x++, e=x++, x++, b=x++, e=x++, a=x++);
>
> Now what are the values of a/b/c/d/e/f?  Do you evaluate 
> arguments in the order of the call, or the order of the 
> function definition?
>
They are in the order of declaration of the function. But here 
again you have 7 parameter for a function who takes only 6. But 
they will have a=1 b=2 c=3 (d=4)
There's no reason to evaluate it any other order as the code 
generation requires that the caller populates the registers/stack 
in the order the function expects.


More information about the Digitalmars-d mailing list