Re: Operator precedence

Liste des GroupesRevenir à cl awk 
Sujet : Re: Operator precedence
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.awk
Date : 30. May 2024, 05:59:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3914l$1i5vg$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 26.05.2024 00:26, Kaz Kylheku wrote:
On 2024-05-25, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
(Mind my remark that mathematicians and computer scientists were
involved in the Algol 68 definition, and that this topic had been
discussed there, and despite the old mathematical convention they
decided to consistently streamline the definition. Frank Pagan's
Algol 68 book, for example says that _every_ monadic operator has
higher precedence than any dyadic operator. And that makes sense;
also in my opinion. I consider Algol 68 also a landmark due to its
extraordinary formal definition, that's why I emphasize it here as
an outstanding paragon.)
 
What they are effectively saying is that the dyadic power operator A**B
(or A^B or whatever it is) bears no syntactic relation to the 2D notation
involving a superscript. I.e. it is a completely different syntactic
interface to the same abstract operation. As such, it can have its own
precedence rules, not hinged to the superscript power notation.

There's three power operators in Algol 68 ('UP', '^', '**') each with
the same default precedence (and each individually changeable.

What the Algol 68 report says on priorities is:

 Priority-declarations are used to specify the priority of operators.
 Priorities from 1 to 9 are available.
 Since monadic-operators have effectively only one priority-level, which
 is higher than that of all dyadic-operators, monadic-operators do not
 require priority-declarations.

 Formulas are either dyadic or monadic: e.g., x + i or ABS x. The order
 of elaboration of a formula is determined by the priority of its
 operators; monadic formulas are elaborated first and then the dyadic
 ones from the highest to the lowest priority.

 https://jmvdveer.home.xs4all.nl/en.post.algol-68-revised-report.html

This is IMO a very clear and sensible definition. It resembles the
property that I upthread mentioned as "tight binding" of monadics.
(I know your mileage varies.)

Janis


Date Sujet#  Auteur
23 May 24 * Operator precedence27Janis Papanagnou
23 May 24 `* Re: Operator precedence26Kaz Kylheku
23 May 24  `* Re: Operator precedence25Axel Reichert
24 May 24   +* Re: Operator precedence21Janis Papanagnou
24 May 24   i+* Re: Operator precedence17Janis Papanagnou
24 May 24   ii`* Re: Operator precedence16Kaz Kylheku
25 May 24   ii +* Re: Operator precedence13Axel Reichert
25 May 24   ii i`* Re: Operator precedence12Janis Papanagnou
26 May 24   ii i `* Re: Operator precedence11Janis Papanagnou
26 May 24   ii i  +* Re: Operator precedence4Kaz Kylheku
30 May 24   ii i  i`* Re: Operator precedence3Janis Papanagnou
30 May 24   ii i  i `* Re: Operator precedence2Axel Reichert
31 May 24   ii i  i  `- Re: Operator precedence1Janis Papanagnou
26 May 24   ii i  +* Re: Operator precedence4Christian Weisgerber
26 May 24   ii i  i+* Re: Operator precedence2Kaz Kylheku
30 May 24   ii i  ii`- Re: Operator precedence1Janis Papanagnou
30 May 24   ii i  i`- Re: Operator precedence1Janis Papanagnou
30 May 24   ii i  `* Re: Operator precedence2Axel Reichert
31 May 24   ii i   `- Re: Operator precedence1Janis Papanagnou
25 May 24   ii `* Re: Operator precedence2Janis Papanagnou
26 May 24   ii  `- Re: Operator precedence1Kaz Kylheku
30 May 24   i`* Re: Operator precedence3Axel Reichert
31 May 24   i `* Re: Operator precedence2Janis Papanagnou
1 Jun 24   i  `- Re: Operator precedence1Axel Reichert
24 May 24   `* Re: Operator precedence3Kaz Kylheku
25 May 24    `* Re: Operator precedence2Axel Reichert
26 May 24     `- Re: Operator precedence1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal