comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Language lawyer question: Equality on 'Access attributes
Date: 10 Jan 2004 14:09:14 -0500
Date: 2004-01-10T14:09:14-05:00	[thread overview]
Message-ID: <wccad4vipt1.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: Y7Gdna8Iw5nrOmKiRVn-jg@comcast.com

"Robert I. Eachus" <rieachus@comcast.net> writes:

> So let me take the example and modify it a bit:
> 
>   package Pak1 is
>       type Ptr1 is access Integer;
>       X : aliased Integer;
>       Y : aliased Integer;
>       B : Boolean := X'Access = Y'Access;
>   end Pak1;

I guess all you did was erase the "all"?

> Is your position Bob, that this version is illegal?

Yes.  There's only one "=" of interest here.  So the expected type of
X'Access is Ptr1, which is not a general access type.  You can't do
X'Access returning a non-general access type.

In other words, overload resolution works the same as in the other
example, but there's a legality rule being violated.

>...Now there is no
> visible general access type, or at least none that the user can see.  

Well, I'm presuming you're showing me the whole example!  If there are
some other "=" operators visible that I can't see, then who knows?

> What is the expected type of "=" above?

Boolean.  Not sure what you mean...

>...Can we use the fact that
> anonymous access types don't have equality operators.

I don't see any anonymous access types in the example.
But yes, if there were, the "=" operators that are visible
would not include ones for those anonymous types.
And resolution would proceed accordingly.

> Whew!  First, 3.10.2(2) was a Name Resolution Rule, so it can't make a
> construct illegal.  However, 4.5.2(6) is "Static Semantics."  Can it be
> considered in a name resolution context?

Yes.

>...  And if so does it make a
> construct illegal, or rule it out of consideration.

It just tells us which implicit declarations exist.
That information affects overload resolution.

- Bob



  reply	other threads:[~2004-01-10 19:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-08  2:05 Language lawyer question: Equality on 'Access attributes Adam Beneschan
2004-01-08  7:47 ` Robert I. Eachus
2004-01-08 11:07   ` Dmitry A. Kazakov
2004-01-08 17:18   ` Adam Beneschan
2004-01-08 18:04     ` Robert A Duff
2004-01-08 18:31       ` Ze Administrator
2004-01-08 21:04         ` Robert A Duff
2004-01-09  4:02           ` Ze Administrator
2004-01-09 23:02             ` Robert A Duff
2004-01-10  2:56               ` Ze Administrator
2004-01-09  4:06           ` Ze Administrator
2004-01-09 23:05             ` Robert A Duff
2004-01-10  3:03               ` Ze Administrator
2004-01-10 13:47                 ` Marin David Condic
2004-01-10  7:19               ` Robert I. Eachus
2004-01-10 19:09                 ` Robert A Duff [this message]
2004-01-11 14:27                   ` Robert I. Eachus
2004-01-11 21:42                     ` Ze Administrator
2004-01-12  5:16                       ` Robert I. Eachus
2004-01-09  1:28         ` Adam Beneschan
2004-01-09  4:10           ` Ze Administrator
2004-01-09 11:27             ` Dmitry A. Kazakov
2004-01-09 23:09               ` Robert A Duff
2004-01-10 11:56                 ` Dmitry A. Kazakov
2004-01-10 17:08                   ` Robert I. Eachus
2004-01-10 18:40                   ` Robert A Duff
2004-01-09 23:08             ` Robert A Duff
2004-01-10  7:39               ` Robert I. Eachus
2004-01-08 20:36       ` tmoran
2004-01-08 21:06         ` Robert A Duff
2004-01-09  0:27       ` Randy Brukardt
2004-01-09  1:23       ` Adam Beneschan
2004-01-09  1:38         ` Robert A Duff
2004-01-09  6:16       ` Robert I. Eachus
2004-01-09 23:27         ` Randy Brukardt
2004-01-10 16:37           ` Robert I. Eachus
     [not found] ` <hmfvc1-f73.ln1@beastie.ix.netcom.com>
     [not found]   ` <l7v1d1-n33.ln1@beastie.ix.netcom.com>
2004-01-09 23:19     ` Robert A Duff
2004-01-09 23:21     ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-01-09  5:48 christoph.grein
2004-01-09  6:03 christoph.grein
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox