PRECEDENT FOR USE OF =

Terry Sejnowski terry at brl-smoke.ARPA
Tue Jul 1 18:08:33 AEST 1986


In article <1645 at brl-smoke.ARPA> JUNG_E%SITVXA.BITNET at WISCVM.WISC.EDU writes:
>...
>Why can't C be like everybody else?  Practically every language uses
>the equals sign, "=", to test for equality, not as an assignment operator.
> ... Kernighan and Ritchie, in their infinite wisdom, decide
>instead to use "=" for assignments and to create a new operator, "==" to
>test for equality.  Gee, that must have required brains, the brains of
>a 3 year old.
>
>If they had my brains, they would have used Pascal's method.  Better yet,
>they should have let someone else write up C.

	When I first read the above I was ready to flame away, but
I decided to check my facts and come back to it later.  Well now I'm
ready. :-)

	The poster of the message above implies that K&R didn't have
the faintest idea what they were doing and didn't bother to examine
other languages (specifically Pascal) before going on their merry way.
Well this sounded sort of fishy to me and I checked out the dates.

Ancestory of C			Ancestory of Pascal
--------------			-------------------

Algol 60 - 1960 (Inter. Comm.)	Algol 60 - 1960 (Inter. Comm.)
CPL - 1963 (Cambridge and UL)	Pascal - draft written - 1968 (Wirth)
BCPL - 1967 (Martin Richards)	Pascal - first compiler - 1970
B - 1970 (Ken Thompson)		Pascal - first publication - 1971
C - 1972 (Dennis Ritchie)	Pascal - revised report - 1973

	Seems to me that it would be kind of hard to justify using
Pascal as the basis for further work when at best it had been in use
for a year or two.   My impression is that around that time a lot of
languages were being written and picking the winners would have taken a
crystal ball.

	As to the symbols used to denote assignment and test for
equality, I couldn't find any information on B, but the book on BCPL
used := for assignment and = to test for equality.  It also used = to
set the value of a named constant.  It took me a minute to realize what
was going on there so I can see re-examining the issue when designing a
new language.

Quick Jab:
	If Pascal is so good why did its author (N. Wirth) write
two other languages (Modula & Modula II) before deciding he had one
which could be used for system implementation? (Lilith (sp?))

				Bill Bogstad
				bogstad at hopkins-eecs-bravo.arpa

Disclaimer: The above is true to the best of my knowledge.  Corrections
	cheerfully accepted.  Flames to /dev/null.



More information about the Comp.lang.c mailing list