Sujet : Re: Operator precedence
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.awkDate : 26. May 2024, 02:29:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240525152709.521@kylheku.com>
References : 1 2 3 4 5 6 7
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-05-25, Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
This creates a problem if we naively wedge exponentiation into
the grammar, by sticking it into a precedence level above
multiplication, but below unary.
The identity does not hold in exponentiation: (-A)**B
is not -(A**B).
>
Looks like a non-sequitur to me.
Yes; the only point here is to explain why we don't notice this
issue, which is mirrored in multiplication: Given -A*B,
we can cheerfully stick a 0 on it to make 0-A*B. The value
does not surprisingly change. Yet, the underlying precedence
relationships are parallel to those in -A**B vs 0-A**B, where
there isn't an identity which masks the issue.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca