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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!jankok From: jankok@mcvax.uucp (Jan Kok) Newsgroups: net.lang.ada Subject: Re: The equals function. Message-ID: <310@zuring.mcvax.UUCP> Date: Tue, 30-Sep-86 05:31:18 EDT Article-I.D.: zuring.310 Posted: Tue Sep 30 05:31:18 1986 Date-Received: Thu, 2-Oct-86 21:03:47 EDT References: <8609252153.AA03089@ucbvax.Berkeley.EDU> Reply-To: jankok@zuring.uucp (Jan Kok) Organization: CWI, Amsterdam Apparently-To: rnews@mcvax List-Id: In article <8609252153.AA03089@ucbvax.Berkeley.EDU> RRACINE@ADA20.ISI.EDU (Roger Racine) writes: >The problem, according to Pat Rogers is: My summary: declaring an "=" operator for a limited private type which is actually 'access INTEGER' leads to a recursive call of this "=". Roger answers correctly: > all that was needed was: > > if STANDARD."="(LEFT, null) then > My summary: qualify the operator (in prefix notation) instead of try to help the overloading resolution algorithm by qualifying the operands. I ignore other helpful answers which avoid the interesting problem, like: Introduce a hidden type for the 'access INTEGER' type. But then Roger adds: >Unfortunately, the equality operator is not found in package STANDARD! He quotes App. C and section 8.6 of the ARM to support this, and ends with >I checked with two validated compilers, and both rejected the STANDARD."=" >approach. That's the interesting part (to me). I checked with a validated compiler (wellll, expired now), and it recognizes STANDARD."=". So the match is still open, but the problem should not be settled by a democratic check on all validated compilers of course. I tend to accept what the compiler I can use does, and my attempt of an explanation is: 1. According to ARM 4.5.2, "=" is predefined. 2. App. C does not contain, and does not pretend to contain all specifications of predefined operators. It contains a lot of comments. The package STANDARD in App C contains, as it says it should: the type declarations for the predefined types, together with some subtypes and packages. It says that the predefined operators are IMPLICIT. This applies to operators for 'any type' like "=" as well as those for the predefined types. 3. The missing link is: Where does the manual say that STANDARD is the appropriate prefix for the full name of the implicit operators. I would say: if Roger's two validated compilers accept STANDARD."+", they should accept STANDARD."=" as a matter of consequence.