🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.ada
Article #983

Re: Overloading the equality operator

#983
From: Gary Dismukes
Date: Mon, 29 Sep 1986 18:59
28 lines
2079 bytes
Regarding Roger Racine's question about the use of predefined equality:

It is true that a predefined equality operator is implicitly declared
by the declaration of any access type.  However, if an explicit "="
function has been declared for the (limited) private type to which the
access type corresponds, then the predefined equality operator will
be hidden throughout its scope.  This is because the "=" function and
the predefined equality operator are homographs occurring immediately
within the same declarative region and thus the operator will be hidden
by the function (see RM 8.3, paragraph 17).  Note that for two overloadable
declarations to be homographs they need only have the same identifier,
operator symbol, or character literal and the same parameter and result
type profile (see RM 8.3, paragraph 15 and 6.6).  The names of parameters
are not used to determine whether two declarations have the same profile
and that is why it is not sufficient to provide different parameter names
for the "=" function in order to get at the predefined equality operator.
Since the predefined operator cannot be named once it has been hidden in
this way, it is necessary to resort to the derived type solution (or some-
thing less desirable like an unchecked conversion).


Gary Dismukes
TeleSoft

gary@telesoft.uucp                          ucbvax--|   hp-sdd--|
telesoft!gary@ucsd.arpa                     decvax--+--sdcsvax--+--telesoft
                                            ihnp4--|  noscvax--|
Technical Details
Message-ID: <8609292351.AA10607@sdcsvax.UCSD.EDU.ucsd.edu>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!cbosgd!ucbvax!telesoft.UUCP!gary

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!cbosgd!ucbvax!telesoft.UUCP!gary
From: gary@telesoft.UUCP (Gary Dismukes @lizard)
Newsgroups: net.lang.ada
Subject: Re: Overloading the equality operator
Message-ID: <8609292351.AA10607@sdcsvax.UCSD.EDU.ucsd.edu>
Date: Mon, 29-Sep-86 14:59:29 EDT
Article-I.D.: sdcsvax.8609292351.AA10607
Posted: Mon Sep 29 14:59:29 1986
Date-Received: Wed, 1-Oct-86 04:38:24 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 28