comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Language lawyer question: Equality on 'Access attributes
Date: Sat, 10 Jan 2004 12:08:59 -0500
Date: 2004-01-10T12:08:59-05:00	[thread overview]
Message-ID: <gsSdnWKLWJsxrJ3dRVn-sQ@comcast.com> (raw)
In-Reply-To: <btootj$9mr5b$1@ID-77047.news.uni-berlin.de>

Dmitry A. Kazakov wrote:

> Just summarizing...
> 
> Your point is that the compiler should consider all visible types and all
> visible "=" to crunch X'Access = Y'Access. Then X'Access = Y'Access is
> illegal if there is no visible named access types. Then provided:
> 
> type A is tagged null record;
> type A_Ptr is access all A;
> function "=" (Left : A_Ptr; Right : access A) return Boolean;
> X : aliased A;
> Y : aliased A;
> 
> X'Access = Y'Access -- is ambiguous

That I certainly agree with.  But there are two further issues that MAY 
apply in the actual example.  The first is that predefined operators 
don't need to be visible to be considered by overload resolution. 
(Usually there are other overload resolution rules that result in 
interpretations using invisible operators being eliminated.)  The second 
is that the rule that anonymous access types don't have a predefined "=" 
operator is not a syntax or overload resolution rule.

The combination of the above can result in an invisible anonymouns 
access Integer type creating an overload interpretation that is illegal 
rather than ignored.  If RM 4.5.2(6) should be considered as a 
overloading rule, that eliminates potential problems in the original 
case.  (However, the part of the 4.5.2(6) rule for limited types 
shouldn't become a name resolution rule.  The rules for re-emergence of 
predefined equality for limited types are somewhat confusing, but 
changing them might be worse.)

In any case, your example would still be illegal, since the user defined 
"=" is visible.

-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




  reply	other threads:[~2004-01-10 17:08 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
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 [this message]
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