Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site galbp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akgub!galbp!bing From: bing@galbp.UUCP (Bing Bang) Newsgroups: net.lang.c++ Subject: Re: Wish List Message-ID: <307@galbp.UUCP> Date: Wed, 26-Mar-86 09:14:42 EST Article-I.D.: galbp.307 Posted: Wed Mar 26 09:14:42 1986 Date-Received: Sat, 29-Mar-86 01:13:35 EST References: <429@batcomputer.TN.CORNELL.EDU> <> Reply-To: bing@galbp.UUCP (Bing Bang) Organization: Lanier Business Products, Inc., Atlanta, Georgia Lines: 29 Summary: In article <> kwh@bentley.UUCP writes: >In article <429@batcomputer.TN.CORNELL.EDU> garry@batcomputer.TN.CORNELL.EDU >(Garry Wiegand) proposed a new syntax: >> foo = ~foo; --> ~~foo; /* Means: please bitwise-complement foo */ >> foo = !foo; --> !!foo; /* Means: please logically-complement foo */ >> >>Of course, screwily written (macros without proper parenthesizing, for >>example) existing programs would break. > >"~~" would probably be safe since it's a no-op under current semantics; >but "!!" is actually used by some people to convert an int into a canonical >truth-value (i.e. map all non-zero values to 1). I think this usage might >even be mentioned in K&R? Anyway, C++ is designed to extend the C language, >as opposed to being a new language, so I suspect this is unacceptable. i like the idea, i suggest changing the syntax to post operators: foo = ~foo; --> foo~~; /* Means: please bitwise-complement foo */ foo = !foo; --> foo!!; /* Means: please logically-complement foo */ this will avoid any clashes with the existing syntax. bing -- "Break, but never bend." from an oak tree i know ...that can move in two directions at the same time ...akgua!galbp!bing