Order of evaluation for named arguments

Timon Gehr timon.gehr at gmx.ch
Thu Apr 3 18:48:49 UTC 2025


On 4/3/25 20:28, Dennis wrote:
> On Thursday, 3 April 2025 at 17:08:57 UTC, Timon Gehr wrote:
>> Those are all language warts.
> 
> That's a fair position, but it changes some key facts.
> 
> This is no longer about an accident in the implementation of the 
> recently added named arguments being codified in the spec.

I do not really think it is important if the accident is in the named 
argument implementation or in the thing that named arguments have been 
deliberately implemented to be consistent with. I also do not want to 
disparage any of the existing implementation efforts, the spec has been 
a moving target.

This is simply about a commitment that had been made on the newsgroup 
_to change any the existing behavior deviating from left-to-right_ that 
has had only partial follow-through so far, and is now being walked back 
in the spec instead of just a simple: "we have not done it yet because 
it did not seem important enough and we prioritized other things".

> Instead, it's 
> cementing a de-facto standard from since the beginning of dmd. A bad 
> standard, but it's not trivial to revert it everywhere. Given that we 
> all seem to agree that argument evaluation order is more about 
> convenience than being a key ingredient for correct programs, that 
> should help you understand Walter's decision making.

No. If that is the reason, then why say it is about not breaking code.

Anyway, one does not have to commit to doing it oneself or think it is 
important in order to agree it is a good thing to be done in general.


More information about the Digitalmars-d mailing list