Precedent for use of =

rbj%icst-cmr at smoke.UUCP rbj%icst-cmr at smoke.UUCP
Tue Jul 15 06:27:56 AEST 1986


	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		<rbj at icst-cmr.arpa>
PEGGY FLEMMING is stealing BASKET BALLS to feed the babies in VERMONT.

P.S. Probably from Lefty.



More information about the Comp.lang.c mailing list