[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CHAR as FOR loop control variable
From: |
Gaius Mulley |
Subject: |
Re: CHAR as FOR loop control variable |
Date: |
Wed, 03 May 2023 13:27:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Benjamin Kowarsch <trijezdci@gmail.com> writes:
> 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
Hi Benjamin,
indeed - it is quite surprising the amount of operator overloading
occurring for a non OO language :-). All great fun though! For example
the '+' symbol: CHAR, INTEGER (ordinal), FLOAT, COMPLEX, string and SET
types - all interesting and different
regards,
Gaius
Re: CHAR as FOR loop control variable, Gaius Mulley, 2023/05/04
Re: CHAR as FOR loop control variable, Gaius Mulley, 2023/05/04