Home About Subscribe Search Member Area

Humanist Discussion Group


< Back to Volume 34

Humanist Archives: May 22, 2020, 6:33 a.m. Humanist 34.45 - punctuation in the assignment statement

                  Humanist Discussion Group, Vol. 34, No. 45.
            Department of Digital Humanities, King's College London
                   Hosted by King's Digital Lab
                       www.dhhumanist.org
                Submit to: humanist@dhhumanist.org


    [1]    From: Gabriel Egan 
           Subject: Re: [Humanist] 34.39: punctuation in the assignment statement (72)

    [2]    From: Henry Schaffer 
           Subject: Re: [Humanist] 34.39: punctuation in the assignment statement (19)


--[1]------------------------------------------------------------------------
        Date: 2020-05-21 12:49:17+00:00
        From: Gabriel Egan 
        Subject: Re: [Humanist] 34.39: punctuation in the assignment statement

Dear Willard

I think you are probing something important in
this line of enquiry about the "=" sign in
software and asking what role mathematics
has played in the evolution of software since its
invention in the 1940s. All the early applications
of computers were mathematical, I believe, and
indeed the kind of language processing that
Digital Humanities often involves would not
have even counted as a computer application to
the early pioneers because it was not mathematical.

I think to those mathematical minds, the need to avoid
using "=" for assignment was not merely a matter of
ensuring clarity but rather was a more visceral repugnance
at the possibility of someone writing (as one can in
some languages):

   LET X = X + 1

The "LET" part of this statement compounds the offence
because it too has a special meaning in mathematics
when putting a problem expressed in words into symbolic
form, as in "Let x = the radius of the cow".

Incidentally, I don't think we have reached a consensus
yet on what the "=" symbol should mean in computing. Indeed,
I think we don't have a consensus on what "equals" means.
Consider the following Python statements creating and
modifying what is sometimes called an associative array,
or a hash, or a dictionary:

   x = {1: "Original"}
   y = x
   x[1] = "New"
   print(y)

Since 'y' is created in line 2 by being defined as "=" to
'x' -- where 'x' is the key "1" with the value "Original" --
and since there are no more "y =" statements in the program,
many programmers would expect line 4's printing out of 'y'
to produce the key "1" and the value "Original".

But in fact when the above Python code is run, 'y' is printed
out as the key "1" and the value "New". Why? Because the
"=" in line 2 didn't simply make a new and independent copy
of 'x' and call it 'y' -- which is what assignment statements
do in most languages -- but rather it created a new label 'y'
that points to the same dictionary that the label 'x' points
to. Thus changes to 'x' are also changes to 'y' because these
are just two equivalent names for the same dictionary.

Is Python's use of "=" this way -- which applies only
to dictionaries, I believe -- a new sense of "=" to
add to the imperative "copy that to make this" and the
interrogative "is that equal to this"? Or is the Python
convention actually a form of the mathematicians' sense
that "=" means "let's call that this"?

Could this potential confusion be connected to the
fact that the symbol "=" is overloaded with meaning,
being vocalized as "equal" and "equals" depending
on context?

Regards

Gabriel Egan





--[2]------------------------------------------------------------------------
        Date: 2020-05-21 12:04:47+00:00
        From: Henry Schaffer 
        Subject: Re: [Humanist] 34.39: punctuation in the assignment statement

Willard,
  Just one small, but relevant aspect - you ask

On Thu, May 21, 2020 at 3:59 AM Humanist  wrote:

> ...
> But someone (Backus?) chose the colon over other characters available
> on the IBM 029 Card Punch. I wonder, what's wrong with '->'?
> ...

  What was *very* wrong is that it took up another column of the punched
card! Of the 80 column card, 8 columns at the end were for sequence
numbering the cards so they could be put back in order by sorting if the
need was there. Columns 1-5 were for statement numbers, and column 6 was
for indicating a continuation. So there were only 66 columns left and
wasting one of them wasn't to be taken lightly!

--henry



_______________________________________________
Unsubscribe at: http://dhhumanist.org/Restricted
List posts to: humanist@dhhumanist.org
List info and archives at at: http://dhhumanist.org
Listmember interface at: http://dhhumanist.org/Restricted/
Subscribe at: http://dhhumanist.org/membership_form.php


Editor: Willard McCarty (King's College London, U.K.; Western Sydney University, Australia)
Software designer: Malgosia Askanas (Mind-Crafts)

This site is maintained under a service level agreement by King's Digital Lab.