comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Help: redefining equality
Date: 1997/06/17
Date: 1997-06-17T00:00:00+00:00	[thread overview]
Message-ID: <EBxp3w.GK4@world.std.com> (raw)
In-Reply-To: 33A6C7B8.796A@lmco.com


In article <33A6C7B8.796A@lmco.com>, Paul Cohen  <paul.cohen@lmco.com> wrote:
>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 think you mean "non-limited".  The trick (first discovered by John
Goodenough, I believe) is to declare a generic package with a limited
private formal type.  Declare "=" on that.  Then pass in a non-limited
type.  Then reach into the instance to grab the "=" operator on the
non-limited actual type.

Yuck.

(E-mailed and posted.)

- Bob




      parent 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
1997-06-17  0:00 ` Robert A Duff [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