I believe that rules out operator precedence, which is customary to copy from math, for good reasons.
Not all languages do (e.g. smalltalk) but I'm not sure it's what the author intended.
I believe that rules out operator precedence, which is customary to copy from math, for good reasons.
Not all languages do (e.g. smalltalk) but I'm not sure it's what the author intended.
To paraphrase Guy Steele[0] - with the exception of what you learnt in high school, precedence should be eliminated from languages.
[0] any of his talks/papers on meta notation - sorry I don't have a link handy
This intuition is pretty well lost in programming language operator precedence tables.
The solution as I see it: You’d have to enforce using parentheses (in line with «explicit over implicit»), alternatively enforce an ordering of math expressions so that the operators with the highest precedence has to be placed first. This might even be beneficial in tail call optimization, since it minimizes what has to be kept in memory (for the compiler as well as the human reader).
It does not automatically do order of operations. You have to explicitly use parentheses, as you say. However methods in Smalltalk tend to be quite short do to the nature of the system so it tends to not be as messy as one might expect.