Order of evaluation for named arguments

GrimMaple grimmaple95 at gmail.com
Thu Apr 3 12:40:54 UTC 2025


On Thursday, 3 April 2025 at 09:33:30 UTC, Dennis wrote:

On Thursday, 3 April 2025 at 09:33:30 UTC, Dennis wrote:
> initializes `char` to 0xFF and `float` to nan not to be useful, 
> but just as something more predictable

ayy lmao

As a side note, it's probably wise to issue a warning when 
someone does 'no hire' stuff anyway, eg this code:
```d
int t = 1;
auto z = t++ + ++t;
```
Should explicitly state that:
```
Warning: variable `t` is modified several times within one 
sequence point, consider refactoring.
```

Same goes for named arguments (bonus point - it's the same 
mechanism and the same warning!)
```d
var t = 1;
foo(a: t++, b: t++); // Warning: variable `t` is modified several 
times within one sequence point, consider refactoring
```


More information about the Digitalmars-d mailing list