3 ms·
APL (and, its derivatives, I think) evaluate strictly right to left, so a * b + c is a * (b + c). It might be jarring at first but I really came to enjoy the
by sleepydog 6y ago
APL (and, its derivatives, I think) evaluate strictly right to left, so
a * b + c
is a * (b + c). It might be jarring at first but I really came to enjoy the consistency, I never had to remember operator precedence, which helps in a language like APL where most functions are infix.
- tragomaskhalos 6y agoConversely, Smalltalk is left-to-right, so a + b * c is (a + b) * c which is simply a result of every operation being a message send - muddling the rules with precedence would be likewise confusing, and would ruin the simplicity of the grammar.
- guram11 6y agoand in forth a b + c * I believe language with "default precedence" was meant to help us write less (parenthesis) but in the long run we ended up abusing (it)