Order of evaluation for named arguments

Ogion ogion.art at gmail.com
Thu Apr 3 14:41:58 UTC 2025


On Thursday, 3 April 2025 at 12:40:54 UTC, GrimMaple wrote:
> 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.
> ```

Some newer languages don’t have increment/decrement expressions. 
These expressions are great for writing “clever” code, and nobody 
likes reading and debugging “clever” code. And in trivial cases, 
`i++` is not *that* much better than `i += 1` to justify the 
additional language complexity and potential for misuse.

Maybe we could deprecate them altogether. But I imagine the 
pushback.


More information about the Digitalmars-d mailing list