[comp.lang.misc] :=

malton@csri.toronto.edu (Andrew Malton) (10/04/89)

Apparently := to express the assignment operation was used faute de mieux
in Algol since the arrow <--- originally chosen for this purpose wasn't
available on teletypes. Does anyone know a reference for this story?
Or, is it folklore.

Please send email.

-----
Andrew Malton, U of Toronto Dept of Computer Science
malton@csri.toronto.edu

dik@cwi.nl (Dik T. Winter) (10/04/89)

In article <1989Oct3.182931.518@jarvis.csri.toronto.edu> malton@csri.toronto.edu (Andrew Malton) writes:
 > Apparently := to express the assignment operation was used faute de mieux
 > in Algol since the arrow <--- originally chosen for this purpose wasn't
 > available on teletypes. Does anyone know a reference for this story?
 > Or, is it folklore.
 > 
It is partly folklore.  (Oh dear, it appears that none of my Algol 60 reports
and Algol 60 revised reports are here at home, so the terminology may be a
bit wrong.)  Back in the time of Algol 60 transportation of a program by
means of paper tape (e.g. 5 level Alcor according to DIN standards) or
punched cards (Yuck) was no consideration (it simply was not done). So
there was a simple definition of the language where each installation
would provide the symbols to represent the language in some way.  There
was a publication language that contained all kind of symbols not found
on most punching devices of those times (like logical and and or, these
are still not found).  Also the publications used underscored words for
special words (so no reserverd words).  Btw. the device I used when
punching Algol 60 programs on 7-level papertape (a Friden Flexowriter)
knew about underlining and logical and, or and not etc, and of course
the compiler understood them also.

Difficult symbols were: string open/close, assignment, exponentiation,
lower 10 for exponents in numbers, multiplication (a serifless x),
logical and, or, not and equivalence, and of course underlined words.
(I may have forgotten some.)  And of course in Algol 60 case was (ought
to be?) significant.  The outlook of the report and revised report comes
mainly from the fact that it was produced by Peter Naur in Copenhagen
using said Flexowriter.  They lacked back arrows for assignment (they
were replaced by :=), proper string quotes (they were pasted by hand),
and exponentiation (I do not know what it looked like in the reports,
we used a vertical bar overprinting a logical and).
(I may be a bit wrong here, it is all from memory, and the Flexowriters
in Copenhagen were a bit different from those at our institute.)
I have seen Algol 60 programs with proper up arrows and left arrows
from other installations.  So it was not choosen as such in Algol 60
but by the users (the installations).

And of course I have seen programs like the following (using Knuths
much later Algol 60 notation from, I believe 1964):
	'debut'
		ecrit('('Allo monde.')')
	'fin'
We even had programs to translate French Algol 60 to English (to allow
us to compile and run programs from France) and vv. (to confuse our friends).
-- 
dik t. winter, cwi, amsterdam, nederland
INTERNET   : dik@cwi.nl
BITNET/EARN: dik@mcvax

UH2@PSUVM.BITNET (Lee Sailer) (10/04/89)

I vaguely remember that <-- (a one character left arrow) was included in
some early versions of ASCII, about 1970 or so.  When the final definition
finally settled down, it was gone.  Hence :=.

toma@tekgvs.LABS.TEK.COM (Tom Almy) (10/04/89)

In article <1989Oct3.182931.518@jarvis.csri.toronto.edu> malton@csri.toronto.edu (Andrew Malton) writes:
>Apparently := to express the assignment operation was used faute de mieux
>in Algol since the arrow <--- originally chosen for this purpose wasn't
>available on teletypes. Does anyone know a reference for this story?

I used Teletypes (TM) that had the left arrow, and I remember it being on
some early ASCII charts. At one point the ASCII standard was revised and the
left arrow became an underscore.

I used an HP Algol on an early HP minicomputer (2114?) and used the left
arrow for assignment. Also Smalltalk-80 uses the left arrow for assignment;
when you look at the character code, it is the underscore. The APL character
set has a left arrow for assignment as well.

I personally would like to see the left arrow back. It makes more sense
than colon equal (gag, why couldn't they at least have used <- ?) and both
of these are easier to explain than the use of just the equals sign for
assignment.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

firth@sei.cmu.edu (Robert Firth) (10/05/89)

In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:

>I personally would like to see the left arrow back. It makes more sense
>than colon equal...

The Algol-60 that people used at the Royal Military College still had the
back arrow in 1973; it was in the 64-character code of the ICL computers.
So, when we moved to PDP-11 (and, later, VAX-11), we simply kept it
and added ':=' as an alternative.  By changing the bitmap used by
our Versatex (TM) matrix printer, we made the ISO underscore look
like a back arrow, so those who hated ':=' could read the printed
copy of their code and feel happy.

The reason I dislike ':=' is purely practical: the two characters
are on different shifts, and when typing fast I tend to end up with
";=" or ":+" far too often.  For the same reason, I detest the
underscore as the break character in languages like Ada.  (There
is another reason to detest it - when faced with things like
"Text_IO.New_Line" the eye naturally groups the components by
following the physical separation, so "." is psychologically
more tightly binding than "_" and the actual lexis is counterintuitive.)

Unfortunately, it's probably too late to change back.  Though we
should surely use the impending change to ISO Latin-1 as a reason
to rethink some of the graphical symbols used in programming languages.

bard@brigid.cs.cornell.edu (Bard Bloom) (10/05/89)

In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>
>I personally would like to see the left arrow back. It makes more sense
>than colon equal (gag, why couldn't they at least have used <- ?) and both
>of these are easier to explain than the use of just the equals sign for
>assignment.

They couldn't have used `<-' because of the [near-]ambiguity of parsing
things like `x<-4'.  It might not actually be ambiguous in Algol 60; I don't
think that you could write things like `x <- y <- 4' as you can in Algol 68,
and the two or other things I tried (eg, with conditionals) had only one
type-correct and syntactically correct parsing.)  

They probably thought about using <= too, but that looks too much like a
comparison.  

I actually prefer the C style, using "=" for ":=" and "==" for "=", but it's
not a good choice.

-- Bard

djz@cbnews.ATT.COM (Danny Zerkel) (10/05/89)

My personal preference is to spilt these down the middle.

I would use := for assignment and == for comparison.  And not use = at all!
But, I haven't actually worked with a language that does this, so this might
be a bad idea.  I can't help thinking that in a language where assignment
and comparison are equally valid (e.g., C), it would make an obscure sort
of sense to make then symbols as distinct as possible.

----------------------------------------------------------------------------
Danny J. Zerkel
AT&T Bell Labs
Columbus, OH

hallett@pet3.uucp (Jeff Hallett x5163 ) (10/05/89)

In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>I personally would like to see the left arrow back. It makes more sense
>than colon equal (gag, why couldn't they at least have used <- ?) and both
>of these are easier to explain than the use of just the equals sign for
>assignment.

I agree.  In  C, couldn't one  just  use "#define  <- ="?   I probably
could just check this myself, but I'm too shiftless. This might help a
little. 

Just a thought.


--
	     Jeffrey A. Hallett, PET Software Engineering
      GE Medical Systems, W641, PO Box 414, Milwaukee, WI  53201
	    (414) 548-5163 : EMAIL -  hallett@gemed.ge.com
     "Your logic was impeccable Captain. We are in grave danger."

markg@ashtate (Mark Grand) (10/05/89)

In article <89277.090337UH2@PSUVM.BITNET>, UH2@PSUVM.BITNET (Lee Sailer) writes:
> I vaguely remember that <-- (a one character left arrow) was included in
> some early versions of ASCII, about 1970 or so.  When the final definition
> finally settled down, it was gone.  Hence :=.


Prior to 1967 the character code that is now rendered as '_' was a left arrow. 
There are still compilers that will recognize this as an alternative to :=.

markg@ashtate (Mark Grand) (10/05/89)

In article <6054@tekgvs.LABS.TEK.COM>, toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
> I used an HP Algol on an early HP minicomputer (2114?) and used the left
> I personally would like to see the left arrow back. It makes more sense
> than colon equal (gag, why couldn't they at least have used <- ?) and both
> of these are easier to explain than the use of just the equals sign for
> assignment.

Back then (late sixties) keypunches were the most common way of getting a
program into machine readable form.  Not all keypunches had '<'.  

clh@tacitus.tfic.bc.ca (Chris Hermansen) (10/06/89)

In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>I personally would like to see the left arrow back. It makes more sense
>than colon equal (gag, why couldn't they at least have used <- ?) and both

What does
	i<-37
mean, given this symbology; "i becomes 37" or "i lessthan -37"?  I'm sure
there are convenient ways around this now, but look at all the trouble people
used to have with the dangling else :-)

Chris Hermansen                         Timberline Forest Inventory Consultants
Voice: 1 604 733 0731                   302 - 958 West 8th Avenue
FAX:   1 604 733 0634                   Vancouver B.C. CANADA
uunet!ubc-cs!van-bc!tacitus!clh         V5Z 1E5

toma@tekgvs.LABS.TEK.COM (Tom Almy) (10/06/89)

In article <113@tacitus.tfic.bc.ca> clh@tacitus.UUCP (Chris Hermansen) writes:
>In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>>I personally would like to see the left arrow back. It makes more sense
>>than colon equal (gag, why couldn't they at least have used <- ?) and both
>
>What does
>	i<-37
>mean, given this symbology; "i becomes 37" or "i lessthan -37"?

Well, in languages that don't allow embedded assignments operations, there
is no syntactic conflict. As a statement it would be the former and as an
expression it would be the latter. I don't find this confusing from a 
programmers point of view, unlike BASIC's use of "=" for both "becomes"
and "equals". Just try explaining that to a beginning programmer! The 
assignment operation needs something distinctive that does not look like
equals. Maybe we should use "i setq 37". :-)

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

torkil@psivax.UUCP (Torkil Hammer) (10/07/89)

In article <1989Oct3.182931.518@jarvis.csri.toronto.edu> malton@csri.toronto.edu (Andrew Malton) writes:
#Apparently := to express the assignment operation was used faute de mieux
#in Algol since the arrow <--- originally chosen for this purpose wasn't
#available on teletypes. Does anyone know a reference for this story?
#Or, is it folklore.
#
Originally Algol was for publication and used several non-typewriter fonts.
For example, reserved words (begin, end and such) were in boldface.

But TeletypE (tm), No Sir! no you don't in Algol.
By the time it became a programming language the major driving forces
were all European (Denmark, England, Holland) and teletypes are an
American specialty.  We used Flexowriters, some bitchy pieces of machinery
as noisy and clunky and breakdown prone as teletypes but with 2 major
advantages.  The first was that Flexo used 8 row paper tape compared to
teletype 5.  The second was that there was a key for sHIFT INTO UPPER
CASE AND WITHOUT THAT FACILITY ALGOL WOULD HAVE LOOKED LIKE FORTRAN,
AND PASCAL LIKE ALGOL, AND C LIKE PASCAL, AND ADA LIKE C, AND COMPUTER
PROGRAMS WOULD ALL HAVE LOOKED LIKE AMERICAN IMMIGRATION FORMS, AND WE WOULD
ALL BE SCREAMING ACROSS THE NET. BUT THE LOWer case code fixed that, and
let's all rejoice.  (The case shift code was sometimes punched a character
or two after it should have appeared but that went with the territory...)

Flexo codes included some characters not available on the typewriter, but
not the back arrow.  I think they just forgot to put it in.  There was a
subscript 10 as one character to indicate power of 10 in numeric constants.
There was a big sloppy X to use for multiplication.  There was even one for
shift between red and black typewriter ribbon.  Artistic we were.
Error messages brought us in the red and compilation OK brought us back.
There was a non-paper advancing key that gave the _ in lower case and the
| in upper.  It was useful for constructing reserved words, commonly
defined as underscored words, and exponentiation which was also forgotten
(should have been upper case of backarrow) - simulated as the |^ combination
printed in one space.  The quotes weren't there either, but they were done
as |< and |> and |<< which sort of looked funny.  It also forced printer
driver software to do double takes unless we really wanted to look at
_B_E_G_I_N _I_N_T_E_G_E_R N; - and that in turn often annoyed the printer
hardware which was specified to be able to do doubles but really wasn't
expecting to actually have to do it after the selloff demo.  (Line printers
were American, upper case only, and Fortran rarely does double takes).

After the Flexowriter came the Bima, which was a quieter version with a much
prettier font, but even more breakdown prone and couldn't be fixed with
whatever was lying around at 4 am, but that's a whole 'nother story.

You'll get that some other Friday evening.  Bye now

torkil

clh@tacitus.tfic.bc.ca (Chris Hermansen) (10/13/89)

In article <6082@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>In article <113@tacitus.tfic.bc.ca> clh@tacitus.UUCP (Chris Hermansen) writes:
>>In article <6054@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
>>>I personally would like to see the left arrow back. It makes more sense
>>>...
>>What does
>>	i<-37
>>mean, given this symbology; "i becomes 37" or "i lessthan -37"?
>
>Well, in languages that don't allow embedded assignments operations, there
>is no syntactic conflict. As a statement it would be the former and as an
>...
>equals. Maybe we should use "i setq 37". :-)
>

"i setq 37" indeed!  Why not "37 gozinta i"?

Our C programming friends out there, who enjoy the `freedom' that an
expression-oriented language provides, would certainly disapprove of this
type of reasoning for using a language that does not treat assignment
thingies as full-fledged expressions.  Remember the notes scattered around
various U**X manuals about the old "=-" operator (ie what is a=-b?);
the `fix' here was to change the operator to "-=", and all the other
`x-and-becomes' operators similarly.

We more serious types (all 373 of us) that still think Algol 68 was the
supreme being's gift to programming languages would doubtless be horrified
by perverting an expression such as
	y:=(x<-45 'or x>45|sin|cos)(x)
to
	y<-(x<-45 'or x>45|sin|cos)(x)
even though one ought to be able to define an operator to do it |-*


Chris Hermansen                         Timberline Forest Inventory Consultants
Voice: 1 604 733 0731                   302 - 958 West 8th Avenue
FAX:   1 604 733 0634                   Vancouver B.C. CANADA
uunet!ubc-cs!van-bc!tacitus!clh         V5Z 1E5