franka@mmintl.UUCP (Frank Adams) (06/23/86)
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