The assignment character in 3.9 and onward

Ralph Johnson johnson at cs.uiuc.edu
Thu Jun 8 10:59:54 UTC 2006


On 6/8/06, Bill Schwab <BSchwab at anest.ufl.edu> wrote:

> I do not see it that way at all.  Squeak's handling/abuse of underscores
> has been a pain to me for a long time, and I am apparently not alone.
> Please note that I am proposing a solution that would let you type _ for
> assignment.  However, I am convinced that it was a mistake to allow what
> should be an editor macro to get built into the compiler and tarnish the
> sources.

You didn't answer his question.  He wanted to know why it was a pain.
He already knew that someone thought it was a pain.  He argued that it
was not a pain because you could easily convert from one form to
another, and he wanted to know why his argument was wrong.

A simple conversion program will mess up programs that use underscore
for other purposes, such as in a string.  So, sometimes conversion
works fine and sometimes (not very often) it doesn't.  A proper
converter would have to parse the program (or at least scan it) to
only convert underscores used for assignment.  In any case, what if
you are working in another Smalltalk and want to file in some Squeak
code that was never converted?  You have to write your own converter,
and use of underscores often trip people up a little.  It is possible
to get around it, but people who go back and forth between different
Smalltalks  get tired of it after awhile.

Originally ALL Smalltalks used underscore (left arrow) as assignment.
Smalltalk V was the first to use := instead, I think.  VisualAge did
it.  VisualWorks converted about 1990, and I can't remember whether it
came first or VisualAge.  For awhile, a lot of VisualWorks code did it
both ways, but eventually it all got converted to := and I must admit
I was happy to find when I started Squeak to find that it still used
the old left arrow.

The reason people gave for using := instead of left arrow was that it
was easier to display on ASCII (i.e. non-bitmapped) printers and
terminals.  Those things ar relics of history now, thougn the relics
live on in things like keyboards and e-mail.  There is no easy way for
me to include a left-arrow in this message, since I am typing it on
gmail.  The ANSI standard now uses := and all the other Smalltalk's
use it so Squeak should use it, too, even though I think that for
pedagogical reasons, left arrow is better.  For those who do not know
programming, its meaning is more obvious.  For those who do, it is one
more sign that "you are not in Kansas anymore".  The use of an equal
sign for assignment is really stupid and one of the arbitrary and
unintuitive communication choices that programmers have made.  := is a
little better, but not much.  Left arrow makes it obvious that a value
is moving from the right to the left.

-Ralph Johnson



More information about the Squeak-dev mailing list