[Oberon] A little weakness of operators syntax and COPY() removing
Hans Klaver
hklaver at dds.nl
Fri Oct 14 23:50:48 CEST 2016
Stéphane Aulery wrote:
> A little weakness of Oberon syntax is that logical operators for conjunction and negation are "&" and "~" but disjunction is "OR".
I regard the different relative sizes of Oberon's boolean operators as one of the strengths of Oberon syntax: in this way the operator precedence is indicated very clearly by their relative size!
E.g.:
p OR ~q & s =
p OR ((~q) & s)
p & ~q OR s =
(p & (~q)) OR s
The operator with the largest size, OR, has the largest "separating strength" between the terms of the expression, and so should be applied last, after & and ~. The conjunction operator & has intermediate size, and so so separates the terms less than OR, and in this way it is easy to remember that it has higher precedence than OR. And the negation operator ~ is smallest and has highest precedence (should be applied first).
It makes reading Oberon boolean expressions much easier for me.
--
Hans Klaver
More information about the Oberon
mailing list