Bug 14228 – Function argument evaluation spec is inconsistent

Status
NEW
Severity
normal
Priority
P3
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-02-26T22:32:17Z
Last change time
2024-12-15T15:22:51Z
Keywords
spec
Assigned to
No Owner
Creator
briancschott
Moved to GitHub: dlang.org#4039 →

Comments

Comment #0 by briancschott — 2015-02-26T22:32:17Z
The specification at http://dlang.org/expression.html says these things: "The following binary expressions are evaluated in an implementation-defined order: ... function arguments" "The evaluation order of function arguments is defined to be left to right." "Note that dmd currently does not comply with left to right evaluation of function arguments." So, if I'm reading this correctly, the spec doesn't agree with itself, and what it says doesn't matter anyways because the compiler doesn't implement it?
Comment #1 by johannespfau — 2015-02-26T22:58:15Z
A long standing issue. Function arguments should be LTR. Pull request is available, but blocked as it needs a final decision by Walter or Andrei for the evaluation order of (all kinds of) assign expressions. Currently blocked PR: https://github.com/D-Programming-Language/dmd/pull/4035 History/Reference: http://bugzilla.gdcproject.org/show_bug.cgi?id=8 http://forum.dlang.org/thread/[email protected] https://github.com/D-Programming-Language/dlang.org/pull/6 https://github.com/D-Programming-Language/dlang.org/pull/669 https://github.com/D-Programming-Language/dmd/pull/4035 https://issues.dlang.org/show_bug.cgi?id=6620 BTW: The spec doesn't really contradict itself: "_are_ evaluated in an implementation-defined order: ... function arguments"" is what _does_ happen. "The evaluation order of function arguments is _defined_ to be left to right." is what _should_ happen. "Note that dmd currently does not comply with left to right evaluation of function arguments." explains the difference.
Comment #2 by robert.schadek — 2024-12-15T15:22:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4039 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB