Also, this same consistency is what holds for mappings. (Just imagine foo and bar to be mappings in the commented, and the result becomes the same.)
It's not the same thing. In the mapping case it's a question of precedence of values for the same index, whereas in the array case it's a question of precedence of the order between the values. The right hand operand should have higher precedence of values since it's the "change" operand (following my reasoning in 9418001). When it comes to precedence of order it's instead the left ("main") operand, for (among other things) the reason I've mentioned in 9418001.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-12-03 20:51: Subject: `| and order on arrays
Also, this same consistency is what holds for mappings. (Just imagine foo and bar to be mappings in the commented, and the result becomes the same.)
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
It's not the same thing, but it's quite dual. In one case, it's a question of precedence of values for the same index, and in the other it's a question of precedence of index for the same value.
Since the operations are not destructive, your notions of "change" and "main" are quite arbitrary and not inherent in the operations themselves.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-03 23:12: Subject: `| and order on arrays
It's not the same thing. In the mapping case it's a question of precedence of values for the same index, whereas in the array case it's a question of precedence of the order between the values. The right hand operand should have higher precedence of values since it's the "change" operand (following my reasoning in 9418001). When it comes to precedence of order it's instead the left ("main") operand, for (among other things) the reason I've mentioned in 9418001.
/ Martin Stjernholm, Roxen IS
Yes, there is a duality but I can't see any purpose in mapping that into the same precedence rule.
No, my notions of "main" and "change" aren't arbitrary; among other things they have ground in the behavior of realloc(3), which makes a good efficiency reason for the distinction I make. It's true that it isn't connected to the logical operations per se, but the operators that implements the operations should nevertheless take it into account, since the op= forms in fact exist and makes it possible to optimize many instances to destructive operations.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-12-03 23:37: Subject: `| and order on arrays
It's not the same thing, but it's quite dual. In one case, it's a question of precedence of values for the same index, and in the other it's a question of precedence of index for the same value.
Since the operations are not destructive, your notions of "change" and "main" are quite arbitrary and not inherent in the operations themselves.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
pike-devel@lists.lysator.liu.se