5 days ago
On 4/3/25 21:26, Dennis wrote:
> On Thursday, 3 April 2025 at 18:48:49 UTC, Timon Gehr wrote:
>> This is simply about a commitment that had been made on the newsgroup _to change any the existing behavior deviating from left-to-right_ that has had only partial follow-through so far,
>> and is now being walked back in the spec instead of just a simple: "we have not done it yet because it did not seem important enough and we prioritized other things".
> 
> I wasn't aware of that commitment, have any implementation changes been made since that? And do you have a link to the newsgroup thread?
> 

I only found these so far, unfortunately these do not seem as conclusive as I remember (because they usually talk specifically about "functions" and I suspect some functions are considered to be more function-like than other functions):

TDPL, says function arguments are evaluated left-to-right on page 50.
https://forum.dlang.org/thread/f0pvsn$1pju$1@digitalmars.com
https://github.com/dlang/dlang.org/pull/6
https://lists.puremagic.com/pipermail/digitalmars-d/2011-December/118189.html
https://forum.dlang.org/thread/ylgtwzvqnupnehipxayk@forum.dlang.org
https://forum.dlang.org/thread/vbpjyhxtjmtebnjmidyf@forum.dlang.org

AFAIU both my frontend and SDC went with strict source-order evaluation. That seems like the only sensible generalization of left-to-right function argument evaluation, but perhaps common sense is not so common after all.
3 days ago

On Saturday, 29 March 2025 at 18:38:31 UTC, Steven Schveighoffer wrote:

>

So the question is, should we modify the spec to reflect this, or would it be better to change the compiler to enforce this left-to-right evaluation rule?

Dennis's point that the language already evaluates right-to-left in some cases is good. Also that the spec note about evaluation order essentially means only unnamed arguments since it was written when named args didn't exist. So we could just as well keep the behaviour as is.

However, I don't think changing the behaviour is wrong either. Anyone who was relying on this certainly knew or should have known that s/he is on thin ice. Of course it's unfortunate that we end accidentally end up using implementation-defined features every now and then, but the language can't improve if we let that stop us from changing it. Especially in this case, since it's an young feature that is unlikely to be used that much yet.

So I guess it is up to taste. My personal preference is left to right at the call site. If we're that afraid of breakage the change can wait for the next edition but it doesn't seem necessary to me.

1 day ago
On Saturday, 5 April 2025 at 20:18:28 UTC, Dukc wrote:
> ...
> However, I don't think changing the behaviour is wrong either. Anyone who was relying on this certainly knew or should have known that s/he is on thin ice. Of course it's unfortunate that we end accidentally end up using implementation-defined features every now and then, but the language can't improve if we let that stop us from changing it. Especially in this case, since it's an young feature that is unlikely to be used that much yet.
> ...

Let's adapt the necessary correction to the compiler. Even this update will cause a lot of code not to compile:

https://dlang.org/changelog/2.111.0.html#dmd.auto-ref-put-adjacent

There may also be a warning message (deprecated?) with the update to be made.

SDB@79
1 2 3 4 5 6
Next ›   Last »