[RFC] Operator priorities extensions

Jose E. Marchesi jemarch@gnu.org
Fri Nov 14 00:45:14 GMT 2025


Hello people.

There are two potential extensions regarding priority of operators that
I would like to explore.

Dyadic operators are always given some priority, which is an integral
number between 1 and 9, for example:

   prio // = 9

The first potential extension is something that someone wrote to me
privately about: to allow using a real number as well as an integral
number.  This would expand the number of possible priorities from nine
to infinite:

   prio // = 6.5
  
That gives // ore priority than + and - (6) but less than / and * (7).

The second potential extension is to allow to refer indirectly to the
priority of some other operator, by name.  So for example, if we wanted
// to have the same priority than the integer division operator %, we
would write:

   prio // = %

Both extensions are syntactically sound, as far as I can tell.
Opinions?


More information about the Algol68 mailing list