Order of evaluation for named arguments
monkyyy
crazymonkyyy at gmail.com
Sat Mar 29 23:03:27 UTC 2025
On Saturday, 29 March 2025 at 21:25:17 UTC, Steven Schveighoffer
wrote:
> On Saturday, 29 March 2025 at 18:45:14 UTC, monkyyy wrote:
>>
>> I dont read it as wrong, thats left to right at the callsite;
>> which if the compiler did extra work to break named arguments
>> changing the order of operations would be anti-feature
>
> No, it's the opposite. It takes the order based on the
> parameter order (at declaration), not the argument order (at
> the call site).
>
> I can agree that properly processing the arguments in written
> order could be more difficult to process in the compiler. But I
> don't know for sure.
>
> In any case, there is a mismatch between the spec and the
> implementation.
>
> -Steve
This is a functional vs impertive distinction; math imagines
arguments being reduced by algerbra and in that world the call
site isnt relivent, but for a machine left to right at the call
site is just it doing as told in order.
And Im not saying extra work as in difficult, I mean it
functionally the compiler would need to have extra step or do use
more storage to make it *less expressive* then the lazy thing.
More information about the Digitalmars-d
mailing list