gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CHAR as FOR loop control variable


From: Benjamin Kowarsch
Subject: Re: CHAR as FOR loop control variable
Date: Wed, 3 May 2023 01:50:58 +0900

Hi Gaius

On Wed, 3 May 2023 at 00:09, Gaius Mulley wrote:

This looks like the bug was introduced after fixing the constant char + constant char -> string. 
I suspect the internal INC(ch) is creating a string :-)

Both these bugs confirm the validity of the design concept "avoiding opportunity for error".

Neither bug would have arisen if (1) WG13 had not chosen + as concatenation operator and
(2) Wirth had not replaced Pascal's PRED/SUCC with INC/DEC in Modula-2.

Both of these decisions were bad ideas because they increased opportunity for error.

ch := SUCC(ch) makes a lot more sense than INC(ch) or ch+1.
Likewise ch1 & ch2 makes a lot more sense than ch1 + ch2.
So does UNSAFE.INC(ch) or even SYSTEM.INC(ch).

Shameless plug: these design flaws are of course fixed in M2R10.

regards
benjamin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]