Anonymous
05/18/24(Sat)13:18:53 No.100539928 >>100536019
>you can't simply go and fuck with the explicit parentheses put by the user. They're there for a reason.
If the language specification says that parenthesis are there only for grouping the expression, you can (in an associative operator). If it says they define the order of evaluation then you can't. All the more reason not to have side effects in your language. If you have side effects
f() + (g() + h())
Should f be called first or g? Does the programmer intend that the parenthesis should be computed before anything else? If the language specifies something like that then g and h must be avluated before f. However with no side effects you can evaluate them even at the same time. And it's dumb to express side effect order with parenthesis. Just express them imperatively
x = g();
y = h();
z = f();
z + x + y
Also C says it's undefined behavior so it avoids giving an answer to the order of evalution all together and blatantly tells you parenthesis are to be ignored besides grouping expressions