Home About Subscribe Search Member Area

Humanist Discussion Group


< Back to Volume 34

Humanist Archives: May 24, 2020, 9:58 a.m. Humanist 34.53 - punctuation in the assignment statement

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




        Date: 2020-05-23 09:06:12+00:00
        From: Norman Gray 
        Subject: Re: [Humanist] 34.45: punctuation in the assignment statement

[The following seems to have gone astray, but 
this shepherd found it. Apologies on behalf of 
naughty software and my own sloppy habits. --WM]

Willard, hello.

Just to throw a little more petrol into the fire...

In a Lisp one might write

    > (define x 1)
    > (let ((x (+ x 2)))
         x)
     ...evaluates to 3

In the first line, 'x' is defined to be a synonym for '1'.

In the second line, a variable 'x' is given a value.  What value?  The
value of the expression (+ x 2) (which is lisp-speak for x+2), as
evaluated in the context outside the 'let', namely 1+2, or 3.  Then the
'let' expression has, as its overall value, the value of x, as evaluated
in the context inside the let, namely 3.  The fact that the two
variables happen to have the same name is irrelevant (but it does
confuse the student most instructively).

Now you can take the view that there's technically no _assignment_ here,
merely a sequence of rewritings.  The 'let' indicates that, within the
'let', when x is seen it should be taken to have the value 3, produced
by (+ x 2).  Some variants of this language (there are a silly number of
such variants) don't have any mechanism for changing the value of a
variable -- that is, _re_assignment is inexpressible.

In case you're thinking this is some weird new-fangled language, Lisp is
only just younger than Fortran (one year, I suspect you know this,
Willard), and marginally precedes Algol, so was presumably known to the
Algol designers.

In case you doubt Lisp's mathematical chops, it emerged as a concrete
version of Church's lambda calculus for describing the theory of
computation, and the story goes that when John McCarthy's student Steve
Russell reported that he'd managed to make an actual computer evaluate
Lisp, he was reproached by McCarthy for having missed the point.

I mention this, not to be contrary or whimsical, but to observe that
there's more than one way of expressing computation; that notations
always have a meaning only in context, so that they are arbitrary and
the free choice of the author; and that the point of notation is to
label a particular operation or expression or even thought, rather than
the notation having any intrinsic meaning that can be argued over.

And I think that leads us back to recognising the arbitrariness of ':='
as an Algol notation.  The language designers decided it would be useful
to lexically distinguish assignment from an equality test, they
presumably cast around in their memories for a suitable symbol available
using the keyboards in front of them, which would have some level of
intuitive affordance to the language's users, ':=' fitted the bill, and
thus made they it so.  The only meanings available to be interrogated by
the close-reader may be about those intuitions, or perhaps what that
specific keyboard actually looked like.  At [2] there is a page of
keyboard layouts for 'typewriters' used with early machines: the second
one has ':' physically closer to the user's fingers than '<' or '>'.

Lisp's mathematical background may also touch on your admitted question,
Willard, in the sense that Lisp concretises an abstract mathematical
question, and so seems to perch comfortably on the boundary between
computation (in the sense of adding up) and the theory of computation.

I also observe in passing that the Wikipedia page about the lambda
calculus [1] uses ':=' with an assignment-like meaning which would be
read aloud as something like 'taken to be' or 'replaced by'.  I don't
know if that notation is one that Church or McCarthy, or the Algol
authors, would have used.

Best wishes,

Norman


[1] https://en.wikipedia.org/wiki/Lambda_calculus
[2] http://www.quadibloc.com/comp/kyb01.htm

--
Norman Gray  :  https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK




_______________________________________________
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.