Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!whuts!mtune!rutgers!rochester!ritcv!cci632!ccicpg!nick From: nick@ccicpg.UUCP (Nick Crossley) Newsgroups: comp.lang.c Subject: Re: == vs = Summary: Other assignment operators Keywords: C,assignment,displacement Message-ID: <9998@ccicpg.UUCP> Date: 26 Jan 88 20:14:44 GMT References: <626@PT.CS.CMU.EDU> <214@oink.UUCP> <2681@mmintl.UUCP> Reply-To: nick@ccicpg.UUCP (Nick Crossley) Organization: CCI CPG, Irvine CA Lines: 16 While we are inventing other types of and syntax for assignment, what about the 'displacement' operator which we had in the Algol68C compiler designed by (amongst others) SR Bourne (before he went to Bell to write sh)? This was written ':=:=', and had the same effect as ':=' in that it assigned the value on the right to the variable on the left (loose terminology, I know), but the value of the whole expression was the OLD value of the left hand side, rather than the NEW value as with ':='. This was useful in MANY constructs. One (not very frequent) example is that of swapping two values :- a := b :=:= a; The operate-and-displacement forms were also provided (+:=:=, -:=:=, etc.)