Sujet : Re: Operator precedence
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.awkDate : 25. May 2024, 23:03:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2tn6n$32bqt$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 25.05.2024 23:31, Janis Papanagnou wrote:
On 25.05.2024 13:34, Axel Reichert wrote:
>
It would be interesting to learn about the motivation for spreadsheets
and "bc" to deviate from the mathematical convention.
It's not only these two program types. As noted upthread it's
also Ksh and Algol 68 (for example), and it seems quite common
in computing according to the cited Wikipedia article.
WRT the second question ("deviate from the mathematical convention")
I suppose it's because it's not the best fit for the formalization.
Tight binding of monadic operators appears just natural (to me), so
their "motivation" is quite obvious (to me).
(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.)
(Yet I haven't seen any convincing counter argument. But maybe we
should just agree to disagree, since this topic (as I've read) had
often lead to heated disputes and that's the least I wanted to have
provoked with my post.)
People should be anyway aware of the operator precedences in the
various programming languages since there are obviously yet worse
definitions than the one we've been discussing here.
Janis