comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Record comparison special case
Date: 1999/12/06
Date: 1999-12-06T00:00:00+00:00	[thread overview]
Message-ID: <384bff4a_3@news1.prserv.net> (raw)
In-Reply-To: 82gqnl$k9c$1@nnrp1.deja.com

In article <82gqnl$k9c$1@nnrp1.deja.com> , keniwasa@my-deja.com  wrote:

> Is tagged part of Ada95?  I'm using Ada83.

You have to make it clear that you're using Ada83; otherwise, CLA
readers will assume you mean Ada95.

No, you don't need to say tagged; I just did that so predefined equality
wouldn't reemerge.

However, you can't declare your nonprivate record type as limited in
Ada83, and there's no simple way to override the equality operator for a
nonprivate nonlimited type (in Ada83).  You have to take advantage of a
loophole in the language, called the "Goodenough Trick."  See the Ada
FAQ for details.

<http://www.adahome.com/>


> The problem I had was that the "small parts" are not necessarily the
> same for all records.  I also wanted to be able to merge records whose
> "small parts" did not conflict and identify records whose "small
> parts" did conflict.

Simplest way (in Ada83) is to declare a comparison function:

  type T is <whatever>;

  function Is_Equal (L, R : T) return Boolean;

I don't really understand what you mean by "small parts being in
conflict."  Perhaps with more detail about your problem we can provide
more information.





      reply	other threads:[~1999-12-06  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-03  0:00 Record comparison special case keniwasa
1999-12-05  0:00 ` Matthew Heaney
1999-12-06  0:00   ` keniwasa
1999-12-06  0:00     ` Matthew Heaney [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox