Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ames!ubvax!pyramid!prls!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: == vs = Message-ID: <2794@mmintl.UUCP> Date: 29 Mar 88 19:40:58 GMT References: <11216@brl-adm.ARPA> <2111@chinet.UUCP> <4403@garfield.UUCP> <931@micomvax.UUCP> <1011@mcgill-vision.UUCP> <956@micomvax.UUCP> <1390@eneevax.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Ashton-Tate Corporation, East Hartford Development Center Lines: 38 In article <1390@eneevax.UUCP> noise@eneevax.umd.edu.UUCP (Johnson Noise) writes: > I'm curious, is there anyone other than Ray Dunn that does >not like = and == ? Let me restate my opinion. I want to keep = and == with almost exactly the same syntax as they have now. The only difference is that = does not have as its value the result of the assignment; instead its value is void. A new operator, perhaps :=, should be introduced, which has exactly the definition that = has now. (However, I would expect a good compiler to complain if the result of the operator is not used, something which cannot (reasonably) be done with the current syntax. This means: (1) We still have the simple, one character operator for the common case. This *is* important. (2) If one miswrites = when one means ==, one gets an error message. (3) The proposal cleans up the semantics by eliminating the category of expressions with a non-void type whose value is commonly ignored. (Mostly -- there still may be functions returning values which are commonly ignored.) This means that a strict compiler can check that a value is used if and only if it is not void. (Casting to void is, of course, permitted.) This could actually be introduced into C over a period of years. The first step is to introduce the new assignment operator, continuing to support use of the result of an = assignment as an obsolete feature. At some later point, this could be phased out. In any event, I would like to see something like this in D (if that ever happens). -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108