YAAO (yet another assignment operator)
Benjamin Thompson
bjpt at mulga.OZ
Thu Dec 20 10:21:49 AEST 1984
A bit of history :
Dean Rubine suggested a "->=" operator, to which the response has been mostly
negative. Ron at brl-tgr mentioned a more general "operator" (<binop>=).
The idea of <binop>= strikes me as a very good and very easy to implement idea.
Consider that
X <binop>= Y; (call this form 1)
is exactly the same statement as
X = X <binop> Y; (call this form 2)
Given that <binop> is a legal operator, all C compilers already have code
to compile form 2. All we have to do now is modify the compiler(s) to convert
form 1 to form 2. This should be utterly trivial, and allows us to add a
nice bit of generality to C.
More information about the Comp.lang.c
mailing list