Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!think!caip!brl-adm!brl-smoke!smoke!rbj@icst-cmr From: rbj%icst-cmr@smoke.UUCP Newsgroups: net.lang.c Subject: Re: Re: Precedent for use of = Message-ID: <2219@brl-smoke.ARPA> Date: Mon, 14-Jul-86 16:27:56 EDT Article-I.D.: brl-smok.2219 Posted: Mon Jul 14 16:27:56 1986 Date-Received: Mon, 14-Jul-86 23:58:34 EDT Sender: news@brl-smoke.ARPA Lines: 60 The problem I'm having with the equality discussion (besides my feeling that ASCII's lack of a one-character assignment operator) It's called `='. Assignment is imperative, conditionals interrogative. By the time the assignment is done, the conditional is true. In english we say `That's OK!' or `That's OK?' and we don't get confused. [: Making the same symbols mean different things depending on the context 1) is nothing new. :] 2) Is nothing new? D.C. al coda, etc, etc. Perhaps `<-' should have been the assignment operator. After all, they chose `->' for points to when `@' would have done just nicely. C'mon now, nobody *really* used `@' & `#' for erase & kill did they :-) The problem with C is that the extra power it offers above other high level languages are all really shortcuts inherited from assembly languages. The "=" - "==" similarity plays upon this. Allowing assignment in conditionals is no syntactic sugar. It avoids duplication of code by localizing it in one place. C extends an open invitation to obscure hand optimizations and deliberately tricky code, Which mature individuals will learn to avoid. Witness both Chris Torek's and Doug Gwyn's preference for `if ((a = b) != NULL)' over `if (a = b)'. I myself prefer the latter, but what do I know? to the point where it gives the impression of being written for the express purpose of allowing this. You figured it all out! DMR wrote C so everybody could post articles about how smart he is! Who cares about computers anyway? Seriously, what looks like tricks to some is often the limits of their own experience. Why should assignment be any different than `+'? The array-pointer ambiguity is another example; people may rail all they want, but a lot of UNIX source plays upon this ambiguity. It's not ambiguous. It's quite well defined. In my opinion, the question is whether or not these idiosyncrasies inherited from minicomputer assembly languages are really desirable in this day and age. Good point. We really ought to change the names of SIGIOT and SIGEMT. Six months of reading UNIX source have convinced me that they aren't. Which UNIX? Charley Wingate (Root Boy) Jim Cottrell PEGGY FLEMMING is stealing BASKET BALLS to feed the babies in VERMONT. P.S. Probably from Lefty.