Order of evaluation for named arguments
monkyyy
crazymonkyyy at gmail.com
Tue Apr 1 02:04:44 UTC 2025
On Monday, 31 March 2025 at 23:16:57 UTC, claptrap wrote:
> On Monday, 31 March 2025 at 21:43:07 UTC, Salih Dincer wrote:
>> On Monday, 31 March 2025 at 19:47:01 UTC, Richard (Rikki)
>> Andrew Cattermole wrote:
>>> [...]
>>
>> +1
>>
>> If the probability is low, as Jonathan emphasizes, then please
>> change the behavior of the D compiler. Or if not, in this
>> case, here is the intermediate solution:
>>
>> **Add a warning or error message**
>>
>> "Named arguments are evaluated in parameter order, so be
>> mindful of side effects!"
>
> Or just require that parameters are always passed in the same
> order as the declaration. Makes this bug impossible, and no
> *silent* breakage.
Doesnt that make the whole thing meaningless
More information about the Digitalmars-d
mailing list