comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: Help: redefining equality
Date: 1997/06/17
Date: 1997-06-17T00:00:00+00:00	[thread overview]
Message-ID: <19970617192001.PAA15297@ladder02.news.aol.com> (raw)
In-Reply-To: 33A6C7B8.796A@lmco.com


Paul Cohen <paul.cohen@lmco.com> writes:
> What was the "standard trick" in Ada83
> for being able to redefine equality for
> non-private types (even though the language
> seemingly does not allow it)?

I don't know if this is a "standard trick," but the way I've always
done it in Ada 83 is to write, for example,

if Equal(X1, X2) then ...

and write my own function Equal.  The problem is that if X1 and
X2 belong to a non-private type, the language doesn't prevent
you from forgetting to call your own function and accidentally
writing

if X1 = X2 then ...

instead.

- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor






  reply	other threads:[~1997-06-17  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-17  0:00 Help: redefining equality Paul Cohen
1997-06-17  0:00 ` John Herro [this message]
1997-06-17  0:00 ` Robert A Duff
replies disabled

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