Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watcgl.UUCP Path: utzoo!watmath!watnot!watcgl!kdmoen From: kdmoen@watcgl.UUCP (Doug Moen) Newsgroups: net.lang.c++ Subject: Re: Wish List (new operators) Message-ID: <516@watcgl.UUCP> Date: Tue, 25-Mar-86 11:33:27 EST Article-I.D.: watcgl.516 Posted: Tue Mar 25 11:33:27 1986 Date-Received: Wed, 26-Mar-86 03:09:41 EST References: <429@batcomputer.TN.CORNELL.EDU> <47900005@ccvaxa> Reply-To: kdmoen@watcgl.UUCP (Doug Moen) Organization: U of Waterloo, Ontario Lines: 33 Summary: Summary: silly intellectual exercise >>As long as we're adding amenities to the language, I have a small wish... >> >>All the binary operators in C have a "please modify" form: >> >> i = i + 3; --> i += 3; >While we're at it, why not make *ALL* the binary operators have a "please >modify" form: && and || do not (at least not in any compiler I've used). The 'please modify' forms of the unary operators could be written as: -= a; ==> a = -a; ~= a; ==> a = ~a; != a; ==> a = !a; I think this is upward compatible with existing C programs. As for making *all* of the binary operators have a 'please modify' form: I think we run into problems with the relational operators: a === b; ==> a = a == b; /* no problem */ a <= b; ==> a = a < b; /* this won't work */ And there are definite problems with overloading '.' and '->': a.b could be interpreted either as referencing member 'b' from struct 'a', or as a function call: operator.(a, b) Both of these interpretations could be valid if both a member 'b' and a variable 'b' are defined. -- Doug Moen (watmath!watcgl!kdmoen) University of Waterloo Computer Graphics Lab