Order of evaluation for named arguments

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


On 4/3/25 19:19, Jonathan M Davis wrote:
> On Thursday, April 3, 2025 3:33:30 AM MDT Dennis via Digitalmars-d wrote:
>> First of all, anyone who designs code to only work when the side
>> effects in an argument list are executed in a particular order
>> is, to put in Walter's terms, a 'no hire' for me. I'd consider
>> the side effects to be unordered just like in C, and D's
>> 'left-to-right' specification is simply a courtesy giving more
>> consistent behavior across compilers.
> 
> Part of me thinks that we should have randomized the order of evalutation
> with every run of the compiler just to shake out code that relies on it.
> Having it be defined to be left-to-right certainly helps with consistency,
> but I completely agree that code shouldn't be relying on it - if nothing
> else, because it's a bad habit to get into given that there are other major
> languages which don't follow it.
> 
> - Jonathan M Davis
> 
> 
> 

This is insane. Just don't allow any non-identifier arguments at that point.


More information about the Digitalmars-d mailing list