🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.ada
Article #985

Re: The equals function.

#985
From: Jan Kok
Date: Tue, 30 Sep 1986 09:31
46 lines
2664 bytes
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.
Technical Details
Message-ID: <310@zuring.mcvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!jankok
References: <8609252153.AA03089@ucbvax.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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
Lines: 45
Apparently-To: rnews@mcvax