Sujet : Re: Operator precedence
De : mail (at) *nospam* axel-reichert.de (Axel Reichert)
Groupes : comp.lang.awkDate : 23. May 2024, 18:14:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87sey8movv.fsf@axel-reichert.de>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Kaz Kylheku <
643-408-1753@kylheku.com> writes:
Furthermore exponentation between on an intermediate precedence level
between unary minus and regular minus is simply insane.
This is a very good argument! Prior to reading it I was kind of
indifferent (at least in infix programming languages, but not in typeset
mathematics).
I made it n-ary in TXR Lisp:
>
1> (expt 5 2)
25
2> (expt 5 2 3)
390625
... so conforming to the habit of typeset mathematics, which is based on
the fact that
c
b
a
could be written as
bc
a
if meant to be left-associative. So having it right associative is the
more terse convention.
For further reading,
https://en.wikipedia.org/wiki/Order_of_operationsis informative, while
https://en.wikipedia.org/wiki/Graham%27s_number https://en.wikipedia.org/wiki/Knuth%27s_up-arrow_notationare curiosities. Have fun!
Axel