Path: utzoo!mnetor!uunet!mcvax!ukc!eagle!icdoc!qmc-cs!keithc From: keithc@cs.qmc.ac.uk (Keith Clarke) Newsgroups: comp.lang.misc Subject: Re: History of := (was: == vs =) Message-ID: <367@sequent.cs.qmc.ac.uk> Date: 27 Jan 88 14:27:44 GMT References: <2337@haddock.ISC.COM> <51300003@uxe.cso.uiuc.edu> <715@PT.CS.CMU.EDU> <3921@aw.sei.cmu.edu> Reply-To: keithc@qmc.ac.uk (Keith Clarke) Organization: Computer Science Dept, Queen Mary College, University of London, UK. Lines: 37 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <3921@aw.sei.cmu.edu> firth@bd.sei.cmu.edu.UUCP (Robert Firth) writes: >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 >symbol, and for assigment they used the left-pointing arrow, to capture >the notion that something flowed from the RHS to the LHS. Algol 60 doesn't allow assignments within expressions, but there would too be an ambiguity, because it allows multiple assignment: (1) p := q = r compare q and r, put the answer in p. (2) p := q := r put the value of r into q and also into p. Parsers normally don't use type information to sort out syntactic ambiguities, so it doesn't really matter if = isn't the operator for comparing booleans; it is certainly the operator for something! I suspect the designers of Algol 60 would have used different symbols anyway, since they stand for quite different things. Maybe the statement/expression distinction faded because of a wish to generalise constructs like the multiple assignment statement? -- Keith Clarke UUCP: keithc@qmc-cs.uucp or ...seismo!mcvax!ukc!qmc-cs!keithc Internet: keithc@cs.qmc.ac.uk Post: Dept of Computer Science JANET: keithc@uk.ac.qmc.cs Queen Mary College Easylink: 19019285 University of London Telex: 893750 QMCUOL G Mile End Road Fax: +44 1 981 7517 London E1 4NS Voice: +44 1 980 4811 x3908 England