Article View: comp.lang.misc
Article #5087Re: History of := (was: == vs =)
From: David Wolpert
Date: Wed, 27 Jan 1988 17:09
Date: Wed, 27 Jan 1988 17:09
54 lines
2854 bytes
2854 bytes
>>legal to have an assigment as a term in an expression, there had to
>>be a way to distinguish between equality and assignment. This is the
>Algol-60 does not allow an assignment within an expression, and there
>would be no ambiguity using '=' for both assignment and equality. This
>is because the designers of Algol-60 had the good sense to make it a
>statement language. They then used for equality the only reasonable
Algol DOES allow assignment as a term in an expression. At least,
Burroughs XALGOL did, and I can't imagine Algol without it. Proof
by quoting excerpt from manual:
<expression> ::=
<arithmetic_expression> | <Boolean_expression> |
<designational_expression> | <concatenate_expression>
<arithmetic_expression> ::=
<simple_arithmetic_expression> | <if_clause>
<arithmetic_expression> ELSE <arithmetic_expression>
<simple_arithmetic_expression ::=
<term> | <adding_operator> <term> |
<simple_arithmetic_expression> <adding_operator> <term>
<term> ::=
<factor> | <term> <multiplying_operator> <factor>
<factor> ::=
<primary> | <factor>*<primary>
<primary> ::=
<unsigned_number> | <variable> | <function_designator> |
( <arithmetic_expression> ) | <partial_word_designator> |
<string> | <concatenate_expression> | <assignment_statement>
-----here--it--is-----
I'm (almost) positive that this was a standard feature of Algol,
and not a Burroughs extention. Wish I had a copy of the "plain"
language definition to quote from.
Actually, there were only two things I missed when I changed from
Algol to Pascal: assignment inside expressions, and OWN variables
(and, maybe a little, being able to hop into GTL/pseudo-Lisp).
_ _
/ \/ \ David Wolpert (303) 667-5000 x3533
/_ __ HEWLETT \ / Measurement Systems Operation
/ / /_/ PACKARD \ / P O Box 301 - Loveland, CO 80539
/ \/ wolpert%hpisla@hplabs.HP.COM
======================================================================
"Be joyful always; pray continually; give thanks in all circumstances"
ps: I describe Algol as a "block" language; Pascal is closer to being
a "statement" language, since it doesn't allow the programmer to nest
blocks freely.
Technical Details
Message-ID:
<5410001@hpisla.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hpcea!hpfcdc!hpisla!wolpertReferences:
<2337@haddock.ISC.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hpcea!hpfcdc!hpisla!wolpert From: wolpert@hpisla.HP.COM (David Wolpert) Newsgroups: comp.lang.misc Subject: Re: History of := (was: == vs =) Message-ID: <5410001@hpisla.HP.COM> Date: 27 Jan 88 17:09:17 GMT References: <2337@haddock.ISC.COM> Organization: HP Instrument Systems Lab - Loveland, CO Lines: 54