Supporting Structure Comparison

Tim Maroney tim at unc.UUCP
Wed Oct 5 07:29:49 AEST 1983


Adding structure comparison by means of infix operators to the compiler
would almost certainly be a Big Mistake at this point.  That's not a trivial
problem, and what's more, it will not be particularly effective with respect
to many structures, since so many structures contain pointers and the
"equality" you want to test has nothing to do with the equality of pointers
compared as integers.

What we really want is easy manipulation of complex numbers for all the
number-crunchers out there who will stick to Fortran until C gets complex
numbers with infix operators and high-speed coding of operations (instead of
[god forbid] procedure calls).  The addition of complex numbers is the
sanest idea I've heard yet for extension of C.  There is a particular
problem to be solved, and a simple way to solve it that inarguably increases
the utility of the language.  Further, it shouldn't be too difficult to add
it to any well-organized compiler.

I have come to realize that most language modifications are harmful and
unneeded, but I also know that some are extremely useful.  C has over the
years added many things, most of which are good ideas (structure passing by
value and the void keyword are two recent ones).  I feel fairly strongly
that the addition of the complex data type would be a good thing.

_________________________
Tim Maroney
duke!unc!tim (USENET)
tim.unc at udel-relay (ARPA)



More information about the Comp.lang.c mailing list