Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newshost.marcam.com!usc!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: Smalltalk assignment syntaxt history
Message-ID: <D4IMJv.qq@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <9502232117.AA04258@fred.nfuel.com>
Date: Fri, 24 Feb 1995 17:43:07 GMT
Lines: 67

In article <9502232117.AA04258@fred.nfuel.com>,
Travis Griggs  <t3018@BWC01.NFUEL.COM> wrote:
>One of the guys here who is just learning Smalltalk made a trivial but
>nevertheless interesting observation. He has the some of the Smalltalk
>books (the Blue, I believe) and he's noted that when the text documents
>methods, it does the assignment with the left arrow symbol (a character
>we obviously don't have on our keyboards). What is the history on this,
>was it possible on some of the original work done for Smalltalk to get
>this character into the source of Smalltalk methods? And how come the
>various vendors chose to use ':=' rather than somethng that more closely
>mirrored the documentation like '<-'. I know there's an oldtimer somewhere
>out there that can enlighten me on the history here :).
>
>Travis Griggs
>Siemens Power Corporation

The older versions of ParcPlace Smalltalk (Smalltalk-80 v 2.5 and
below) had quite a different look and feel from present day
Smalltalks.  As was mentioned (correctly) in another response, the
underscore key (_) was used as an assignment symbol and actually
displayed on the screen as a single-character backwards arrow.
Digitalk's Smalltalk/V never had this feature and used := instead (I
suspect the := was taken from PASCAL).  A character combination like
<- might have looked nicer but would, unfortunately, lead to
ambiguities.  For example, consider the following:

     a<-5

Does this mean:
    a <- 5
or:
    a < -5

Also, it may be confused with -> which creates an Association
    5->a

is a binary message which creates (Association new key: 5 value: a)
and shouldn't be confused with an assignment of 5 into a variable a.

The other advantage of := (this is my speculation here) is that the
':' character was already known to the compiler to be a keyword
indicator and couldn't be used as a binary message.  It makes sense to
use it in a special symbol representing an assignment.

Incidently, other differences in old versions of Smalltalk-80 are:
   - Scroll bars only appeared when the mouse was moved into the
corresponding view.
   - There was no window title bar.  They had Window labels which
simply had the name of the window written into a rectangular tab above
the top left of the window.
   - OK/Cancel or Yes/No windows caused the cursor to change to a
thumbs up or thumbs down depending on which button the cursor is moved
to. (These cursors are still present in VisualWorks 2.0).
   - There was a system menu that appeared when you clicked on the
gray screen background.  This allowed you to save the image, open
browsers, open workspaces, and other things.

Those were the days.

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
