From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef86287aa487b07a X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Pb with use of redefined "=" operator Date: 1998/11/05 Message-ID: <3641D551.CCA4379C@elca-matrix.ch>#1/1 X-Deja-AN: 408709624 Content-Transfer-Encoding: 7bit References: <363F62F3.3FF7@club-internet.fr> <3640B520.D7BEEE72@elca-matrix.ch> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-05T00:00:00+00:00 List-Id: 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;