Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!brl-adm!adm!neville@ads.arpa From: neville@ads.arpa Newsgroups: comp.lang.c Subject: Re: Unary plus Message-ID: <6772@brl-adm.ARPA> Date: Wed, 8-Apr-87 11:59:14 EST Article-I.D.: brl-adm.6772 Posted: Wed Apr 8 11:59:14 1987 Date-Received: Sat, 11-Apr-87 09:10:03 EST Sender: news@brl-adm.ARPA Lines: 41 >>It is not a _minor_ matter when a piece of code doesn't execute the way it >>reads, and it is not a _minor_ matter when something like the proposed unary >>plus override on parenthesis evaluation order is added to a language. > >I thought I was the only one who thought the unary plus was a kludge. But >then I didn't even realize my parentheses weren't being honored. Seriously. Ditto. i have thought, from the first i heard of it, that the unary '+' was a remarkably bad syntax choice and a kludge to cover basic deficiencies in handling parenthesis evaluation directives. It wasn't until reading about unary '+' that i knew that C might disregard my parens. The other bad choice, in my opinion, is '##' in the preprocessor for concatenation. What i prefer (and it was implemented in a special preprocessor done by Mary Larson at U.Mass.) is to borrow the backquote construct from the Un*x shells: let var_base_name_`count` become var_base_name_. If the part within `` wasn't a compile-time variable, then you would just have simple concatenation. i also would have the backquote mechanism do substitutions WITHIN QUOTED STRINGS, i.e. it would be absolute. Of course, you could escape the backquote character if needed. In our BSD's /lib/cpp, the backquote char is used for BCD constants but that didn't interfere with our usage. If there are other features with which this would interfere, i would like to hear about them. i fully realize that some people might dislike this method because it carries another Un*x notion into the world of C, but i believe this particular Un*x notion is one of greatest things since sliced bread. -neville ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ U.S. Mail: Neville D. Newman Advanced Decision Systems 201 San Antonio Circle, Suite 286 Mountain View, CA 94040-1289 Phone: (415) 941-3912 Net mail: neville@ads.arpa (internet-relative)