comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Pb with use of redefined "=" operator
Date: 1998/11/05
Date: 1998-11-05T00:00:00+00:00	[thread overview]
Message-ID: <3641D551.CCA4379C@elca-matrix.ch> (raw)
In-Reply-To: m3iugv70ke.fsf@mheaney.ni.net

Matthew Heaney wrote:

> I make it a point that when I create a composite type --an abstract data
> type, or "open," as in your example-- that I guarantee equality will
> compose.
> 
> It is for this reason that I always implement (the full view of) ADTs as
> tagged, even if the partial view is not itself tagged.

But if you do that, then you don't need to explicitly import "=" as a
generic formal, because the reemergence problem does not exist with
(visibly or not) tagged types.

This also makes the following trick unnecessary:

> But the solution is trivial: just don't use equality for the composite
> type!  What I do is, always declare the equality for composite types as
> abstract:
> 
> [...]
>    type Pair is
>       record
>          X, Y : Item_Type;
>       end record;
> 
>   function "="
>     (L, R : Pair) return Boolean is abstract;




  reply	other threads:[~1998-11-05  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-03  0:00 Pb with use of redefined "=" operator Fran�oise & Herv� BITTEUR
1998-11-04  0:00 ` dewarr
1998-11-04  0:00   ` Tucker Taft
1998-11-04  0:00 ` Mats Weber
1998-11-04  0:00   ` Fran�oise & Herv� BITTEUR
1998-11-04  0:00 ` Matthew Heaney
1998-11-04  0:00   ` Mats Weber
1998-11-05  0:00     ` Matthew Heaney
1998-11-05  0:00       ` Mats Weber [this message]
1998-11-05  0:00         ` Matthew Heaney
1998-11-09  0:00           ` Robert A Duff
1998-11-09  0:00             ` Brian Rogoff
1998-11-10  0:00               ` Robert A Duff
1998-11-10  0:00             ` Robert I. Eachus
1998-11-05  0:00       ` dewarr
1998-11-05  0:00         ` Matthew Heaney
1998-11-06  0:00           ` dewarr
1998-11-09  0:00             ` Robert A Duff
1998-11-10  0:00               ` dennison
1998-11-10  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