Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang.c Subject: = and := Message-ID: <1568@mmintl.UUCP> Date: Mon, 23-Jun-86 00:44:21 EDT Article-I.D.: mmintl.1568 Posted: Mon Jun 23 00:44:21 1986 Date-Received: Thu, 19-Jun-86 03:38:18 EDT References: <5565@alice.UUCP> <8200005@ztivax.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 20 The more I think about it, the more I like the idea of having "=" be an assignment which does not return a value, and ":=" be an assignment which returns its left side after the assignment (i.e., the current C definition of "="). I am not sure whether I like this well enough to actually support putting it into the language, however. Certainly, it would have to be possible to set a switch so as to not get an error for the old use of "=" in any compiler written in this century, at the least. An extension would be to use some variant (perhaps "$=" or "=:") to mean that the result of the expression is the lvalue *before* the assignment. This would enable, e.g., an exchange to be written as "x = y $= x". One drawback is that the idea does not generalize in an immediate and obvious way to the increment and decrement operators. Presumably, "++x" should mean "x+:=1" and "x++" should mean "x+$=1"; but there should be some such notation which means "x+=1". Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Multimate International 52 Oakland Ave North E. Hartford, CT 06108