[Oberon] A little weakness of operators syntax and COPY() removing
Stéphane Aulery
saulery at legtux.org
Mon Oct 17 22:03:33 CEST 2016
Hello Hans,
Le 14/10/2016 à 23:50, Hans Klaver a écrit :
> 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.
I expected more regularity, either by finding non-alphabetic characters
or words (OR, AND, NOT) for all operators. In fact I'm used to words for
the logical operators.
Why not. It's a good mnemonic idea to capitalize on Oberon syntax.
Regards,
--
Stéphane Aulery
More information about the Oberon
mailing list