Order of evaluation for named arguments

claptrap clap at trap.com
Tue Apr 1 21:46:11 UTC 2025


On Tuesday, 1 April 2025 at 17:13:45 UTC, Patrick Schluter wrote:
> On Tuesday, 1 April 2025 at 11:26:34 UTC, claptrap wrote:
>> On Tuesday, 1 April 2025 at 02:04:44 UTC, monkyyy wrote:
>>> 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:
>>>>> [...]
>>>>
>>>> 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
>>
>> I thought the point was to document at call site, ie clarify 
>> long parameter lists, and enable skipping defaults?
>>
>> I mean I don't see the point of just being able to change the 
>> order the parameters are passed in?
>
> It can happen that you change the order of parameter at the 
> definition site. This should not require modiying all call 
> sites with named arguments.

It'd still break all call sites that don't use named parameters, 
maybe even silently if you're not careful. So its a thin argument 
IMO, changing the order of the parameters just seems like a bad 
idea, its just breakage, for nothing.







More information about the Digitalmars-d mailing list