🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #370

Re: Re: Re^3 (was 2): struct comparison

#370
From: Dave Decot
Date: Mon, 24 Jul 1989 23:25
18 lines
1184 bytes
I really don't see any problem with a definition of structure comparison
that said two comparable structures match if and only if the corresponding
elements compare equal.

If an implementation wants to make holes in structures, that's fine;
it just has to deal with avoiding the holes when generating code to
compare the structures.  An application wishing to compare strucutres
(or things which are potentially structures) should be willing to
put up with a little delay.

Or, if it's smart enough to notice that the particular structures
involved are never modified via aliases, the compiler could initialize
them with 0's in the holes and not worry about them when comparing.

As Donn Terry points out, most of the structures one wants to compare
in practice have no holes, anyway.

Dave
Technical Details
Message-ID: <11580015@hpisod2.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!hpda!hpcupt1!hpisod2!decot
References: <167@ssp1.idca.tds.philips.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!hpda!hpcupt1!hpisod2!decot
From: decot@hpisod2.HP.COM (Dave Decot)
Newsgroups: comp.std.c
Subject: Re: Re: Re^3 (was 2): struct comparison
Message-ID: <11580015@hpisod2.HP.COM>
Date: 24 Jul 89 23:25:56 GMT
References: <167@ssp1.idca.tds.philips.nl>
Organization: Hewlett Packard, Cupertino
Lines: 18