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: Gaius Mulley
Subject: Re: CHAR as FOR loop control variable
Date: Wed, 03 May 2023 16:30:23 +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 21:27, Gaius Mulley wrote:
>
>  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
>
>  Well, pretty much all languages use the arithmetic operators with multiple 
> numeric types, and that makes a lot of sense.
>
> The trouble begins when things become non-obvious and thus misleading, or 
> worse, ambiguous.
>
> Of course a large part of the blame goes to the incompetence of the ASCII 
> committee who were so obsessed with teletypes that they couldn't even think 
> five seconds into the future and wasted all those code points on totally
> unnecessary teletype control codes instead of assigning all teletype commands 
> to a single code with a second code to select the actual command and thereby 
> freeing up more code points for useful symbols, such as the math
> symbols for set union, set intersection, set difference, subset, superset, 
> and others like logical not, logical and and logical or.
>
> But even with the limited set of symbols in the ASCII set, there was no 
> reason to use + for string concatenation. Either & or || could have been 
> used. In fact it was warned against using + in the Milton Keynes meeting but 
> such is the
> dynamic of design by crowds that the worst choices tend to get selected by 
> majority vote.
>
> Also note that whilst the reuse of operators across different types is the 
> original meaning of the term operator overloading, it has not been used with 
> that meaning for decades as the meaning shifted to user definable operators, 
> and
> it is that meaning with which OO languages are associated, not the original 
> meaning. ;-)
>
> regards
> benjamin

Hi Benjamin,

ah yes I recall the Milton Keynes meeting and the desire to see Modula-2
ported to some ancient hardware with a restricted ASCII set.  I vaguely
recall the consternation in the room over BCD and type COMPLEX -
although this might be an over active imagination on my part :-).  April
1985 iirc.

Yes indeed all languages use operator overload to an extent - I can see
why it moved into user space

regards,
Gaius



reply via email to

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