Orphaned Response - (nf)

preece at uicsl.UUCP preece at uicsl.UUCP
Thu Sep 22 13:50:10 AEST 1983


#R:wateng:-27500:uicsl:6400010:000:1049
uicsl!preece    Sep 21 08:09:00 1983

Structure comparison can be very useful, but the nature of the
comparison is almost always not simple enough to be handled by a built-in
capability (except in the one case of testing for absolute equality).
I would not want C to acquire abstract types with operations, but that's
what you need if you want to have general structure operations. I
wouldn't mind having a test for exact match of all named elements of
structures included in C and I wouldn't mind having a structure
assignment operation that set all named elements equal; both features
would sometimes be useful and would involve only modest compiler
effort. But I wouldn't say it was a very important gain, since we can
write the tests explicitly or write them once and call them as a function.
The ability to define exactly what we want comparisons of structures
to do (whether we overload the existing relational operators or
provide some other mechanism) would be very useful, but it doesn't
fit into the texture of C, which is simplicity.

scott preece
pur-ee!uiucdcs!uicsl!preece



More information about the Comp.lang.c mailing list