Deutsch   English   Français   Italiano  
<87sey8movv.fsf@axel-reichert.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Axel Reichert <mail@axel-reichert.de>
Newsgroups: comp.lang.awk
Subject: Re: Operator precedence
Date: Thu, 23 May 2024 19:14:44 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <87sey8movv.fsf@axel-reichert.de>
References: <v2nium$1pl8f$1@dont-email.me> <20240523092856.646@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 23 May 2024 19:14:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="85ea1aefc4960fece415712f4b24e187";
	logging-data="1959042"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+R3x7IYnhzZDukCciGyEheiP3LnnAy+VM="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:EB8ENiKj5bP5VeTnyVN50xBWeU8=
	sha1:4Q1k6cn1X/la3B87bLvoQH6y6SE=
Bytes: 1909

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_operations

is informative, while

  https://en.wikipedia.org/wiki/Graham%27s_number
  https://en.wikipedia.org/wiki/Knuth%27s_up-arrow_notation

are curiosities. Have fun!

Axel