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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 List-Id: 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--|