🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #66

Wish List

#66
From: Garry Wiegand
Date: Thu, 20 Mar 1986 23:05
23 lines
1490 bytes
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;

Why don't the unary operators have one as well? In particular, I sometimes
write loops in which a logical or bit variable oscillates on and off, using
either foo = ~foo or foo = !foo. Would it be more pleasing to the eye to
have:

	foo = ~foo;   -->   ~~foo; /* Means: please bitwise-complement foo */
	foo = !foo;   -->   !!foo; /* Means: please logically-complement foo */

I suppose foo!! and foo~~ should be provided too, for the sake of symmetry with
++ and --.

Of course, screwily written (macros without proper parenthesizing, for
example) existing programs would break. But fortunately there isn't
much extant C++ yet. Just a thought -

garry wiegand
garry%cadif-oak@cu-arpa.cs.cornell.edu
Technical Details
Message-ID: <429@batcomputer.TN.CORNELL.EDU>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!bullwinkle!batcomputer!garry

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!bullwinkle!batcomputer!garry
From: garry@batcomputer.TN.CORNELL.EDU (Garry Wiegand)
Newsgroups: net.lang.c++
Subject: Wish List
Message-ID: <429@batcomputer.TN.CORNELL.EDU>
Date: Thu, 20-Mar-86 18:05:33 EST
Article-I.D.: batcompu.429
Posted: Thu Mar 20 18:05:33 1986
Date-Received: Sat, 22-Mar-86 22:32:09 EST
Reply-To: garry%geology@cu-arpa.cornell.edu.arpa
Distribution: net
Organization: Cornell Engineering && Flying Moose Graphics
Lines: 23