Algol68 Digest, Vol 9, Issue 23

Paul Leyland paul.leyland@gmail.com
Sun Nov 16 11:22:10 GMT 2025


On 14/11/2025 05:36, algol68-request@gcc.gnu.org wrote:
> Send Algol68 mailing list submissions to
> 	algol68@gcc.gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://gcc.gnu.org/mailman/listinfo/algol68
> or, via email, send a message with subject or body 'help' to
> 	algol68-request@gcc.gnu.org
>
> You can reach the person managing the list at
> 	algol68-owner@gcc.gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Algol68 digest..."
>
>
> Today's Topics:
>
>     1. [RFC] Operator priorities extensions (Jose E. Marchesi)
>     2. Re: [RFC] Operator priorities extensions (chris hermansen)
>     3. [COMMITTED] a68: Fix POSIX fopen flags (Pietro Monteiro)
>     4. Re: [PATCH v2] a68: Add lseek(3) to the POSIX prelude
>        (Pietro Monteiro)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 14 Nov 2025 01:45:14 +0100
> From: "Jose E. Marchesi" <jemarch@gnu.org>
> To: algol68@gcc.gnu.org
> Subject: [RFC] Operator priorities extensions
> Message-ID: <87jyztbfxh.fsf@gnu.org>
> Content-Type: text/plain
>
>
> Hello people.
>
> There are two potential extensions regarding priority of operators that
> I would like to explore.
>
> Dyadic operators are always given some priority, which is an integral
> number between 1 and 9, for example:
>
>     prio // = 9
>
> The first potential extension is something that someone wrote to me
> privately about: to allow using a real number as well as an integral
> number.  This would expand the number of possible priorities from nine
> to infinite:
>
>     prio // = 6.5
>    
> That gives // ore priority than + and - (6) but less than / and * (7).
>
> The second potential extension is to allow to refer indirectly to the
> priority of some other operator, by name.  So for example, if we wanted
> // to have the same priority than the integer division operator %, we
> would write:
>
>     prio // = %
>
> Both extensions are syntactically sound, as far as I can tell.
> Opinions?
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 13 Nov 2025 17:00:38 -0800
> From: chris hermansen <clhermansen@gmail.com>
> To: "Jose E. Marchesi" <jemarch@gnu.org>
> Cc: algol68@gcc.gnu.org
> Subject: Re: [RFC] Operator priorities extensions
> Message-ID:
> 	<CACc2_6_2Nw0=ctjmawMMn6rxrcUTEnHzsVcB1y36Y03dhtLiSA@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Jose and list;
>
> On Thu, Nov 13, 2025 at 4:45?PM Jose E. Marchesi <jemarch@gnu.org> wrote:
>
>> Hello people.
>>
>> There are two potential extensions regarding priority of operators that
>> I would like to explore.
>>
>> Dyadic operators are always given some priority, which is an integral
>> number between 1 and 9, for example:
>>
>>     prio // = 9
>>
>> The first potential extension is something that someone wrote to me
>> privately about: to allow using a real number as well as an integral
>> number.  This would expand the number of possible priorities from nine
>> to infinite:
>>
>>     prio // = 6.5
>>
> While my living depends on floating point numbers and I love them dearly, I
> think this is moving into sledgehammer - thumbtack territory.  Personally I
> would prefer between 1 and 100, which to me would give plenty of range for
> fine tuning.
>
> Also generally I haven't seen a compelling demonstration of the need for
> changing it at all; I believe (I have no data to back this up) that the
> choice of 1 - 9 was probably based on thinking that if one had 100 choices
> (or infinite) one might have trouble recalling that some operator is 49 and
> the other 51 (or 4.9 and 5.1) and maybe just decide to use parentheses
> instead.
>
>> That gives // ore priority than + and - (6) but less than / and * (7).
>>
>> The second potential extension is to allow to refer indirectly to the
>> priority of some other operator, by name.  So for example, if we wanted
>> // to have the same priority than the integer division operator %, we
>> would write:
>>
>>     prio // = %
>>
> I like this second idea as it is also good documentation, whereas "prio //
> = 4" forces one to either remember what else is 3,4,5 or to go and look it
> up.
>
>> Both extensions are syntactically sound, as far as I can tell.
>> Opinions?
>>
> My 0.02$CAD worth.

I was the "someone" who suggested the floating point extension to 
operator priority. By enforcing 1<=priority<=10 we ensure that it 
doesn't affect the core language. By allowing intermediate values a 
larger range can be supported easily but no-one, especially purists, 
need include a decimal point.

Inspiration came from FOCAL (a much nicer language than Dartmouth BASIC 
in my opinion) where line numbers are floating point and inserting code 
is much easier than renumbering the whole program with a larger gap 
between existing line numbers.

A usage case may be for something which operates on a programmer-defined 
MODE which should have a priority between two standard operators on, 
say, REALs.

For obvious reasons, I support the proposal.

All also support the other proposal and prefer the "prio //  = prio" % 
version

Paul


More information about the Algol68 mailing list