View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006026 | The Dark Mod | Coding | public | 27.07.2022 20:46 | 28.07.2022 18:31 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | normal | Severity | normal | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 2.10 | ||||
Target Version | TDM 2.11 | Fixed in Version | TDM 2.11 | ||
Summary | 0006026: Wrong order of evaluation in expressions | ||||
Description | Here are a few weird facts about order of evaluation in expressions, true both in materials and in GUI scripts: 1) Same-priority operations are evaluated in right-to-left order. So a-b+c is computed as a-b-c and vice versa. 2) Logical OR and AND are same-priority operations, and are thus evaluated in left-to-right right-to-left order. 3) Comparisons <=, >=, <, > have same priority as == and !=: that's not a big deal, but differs from C/C++ rules. I'd like to fix it and change to exact C/C++ rules. | ||||
Additional Information | Originally reported here: https://forums.thedarkmod.com/index.php?/topic/21535-order-of-evaluation-in-expressions-materials-and-gui/ | ||||
Tags | No tags attached. | ||||
Done in commits: r10043 Execute same-priority operations in left-to-right order instead of right-to-left (GUI and materials). r10044 Adjusted operator precedence like in C/C++. r10045 Fixing ternary operator in GUI scripting. r10046 Removed code for issuing warnings in the cases wth changed behavior. r16576 Fixed evaluation order in two cases where buggy engine behavior makes it different from what's mathematically correct. Note that intermediate revisions contains some code to detect problematic cases and issue warning. But I have detected too few such cases in core assets, so I think it's not worth leaving this code. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
27.07.2022 20:46 | stgatilov | New Issue | |
27.07.2022 20:46 | stgatilov | Status | new => assigned |
27.07.2022 20:46 | stgatilov | Assigned To | => stgatilov |
27.07.2022 20:46 | stgatilov | Relationship added | related to 0005852 |
27.07.2022 20:46 | stgatilov | Relationship added | related to 0005869 |
27.07.2022 20:47 | stgatilov | Summary | Wrong order => Wrong order of e |
27.07.2022 20:47 | stgatilov | Summary | Wrong order of e => Wrong order of evaluation in expressions |
28.07.2022 18:31 | stgatilov | Note Added: 0015085 | |
28.07.2022 18:31 | stgatilov | Status | assigned => resolved |
28.07.2022 18:31 | stgatilov | Resolution | open => fixed |
28.07.2022 18:31 | stgatilov | Fixed in Version | => TDM 2.11 |