Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!aurs01!throop From: throop@aurs01.UUCP (Wayne Throop) Newsgroups: comp.lang.c Subject: Re: :? unique? (was Re: cond. op. on ='s LHS) Summary: Huh? Message-ID: <59608@aurs01.UUCP> Date: 26 Feb 91 18:50:05 GMT References: <326@smds.UUCP> <1210@sheol.UUCP> <334@smds.UUCP> <1991Feb23.215538.10212@Think.COM> <343@smds.UUCP> Sender: news@aurs01.UUCP Lines: 42 > rh@smds.UUCP (Richard Harter) > C follows the "one, two, many" approach to terms. You can say: > OP TERM --x *x -x &x etc > TERM OP x++ x-- etc? > TERM OP TERM x+y x-y x*y etc > TERM [OP TERM]... f(x,..) x,y... etc I'm not sure I follow Richard's point. In what relevant way is x+y+z different from x,y,z so as to justify calling the former a case of "two" and the latter a case of "many", based on operator? IMHO, C operators fall into cases one, two, three, and many. The only case of "three" is ?:, and the only case of "many" is f(). > It occurs to me, offhand, that post decrement and post increment are > the only instances of TERM OP. Does this mean that post incrementing is > ugly? :-) Well.... yes, actually. In the sense that it is made available as a special case hack to what (if present at all) ought to be made a general case, similar to the operate-and-assign operators. Compare, for example, C's assignment operator suite along with the pre-and-post-mumble-ment operators to LISP's LET bindings, along with PROG1 and PROGN. (uh... just the idea, and ignore the awful names) In LISP, one can at least synthesize any sort of preincrement or postincrement on the fly, in any valueish context. In C, you can do some of them, and the others must be done by assignment to a temporary, and hence can't be uttered neatly inside expressions. On the other hand, I don't suppose the post-mumble-ment operators are any uglier than quirky special cases in other Algol-related languages, sigh. At least Algol relatives generally don't have the historical naming baggage of LISP relatives. CAR. CDR. PROGN. LET*. Shudder. Wayne Throop ...!mcnc!aurgate!throop