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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d402e2c741db0d0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-11 06:27:52 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 11 Jan 2004 08:27:51 -0600 Date: Sun, 11 Jan 2004 09:27:50 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Language lawyer question: Equality on 'Access attributes References: <4LKdnRRNyv6AlmCiRVn-ig@comcast.com> <6bSdnYBKy_diPGCi4p2dnA@gbronline.com> <5a6dnSHERdpJtWOi4p2dnA@gbronline.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-2a6l9rX2wdQOsxJYu8avrWhue5yrPmzRBv9ecdzWQ/MvaWN2sDkGnoRaqLux5yffknhP/G1uydstuPn!A+lo+r7bm4ih5ncCBhD3ZLy5zvVQtzKzmNiZj67vRPIPL+U3jXj5encPLea15g== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4331 Date: 2004-01-11T09:27:50-05:00 List-Id: Robert A Duff wrote: > I guess all you did was erase the "all"? Yep. >>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? I think I am now convinced that GNAT has a bug. The potential problem with anonymous access types I thought was the problem can occur, but only if declarations like: function "=" (Left : A_Ptr; Right : access A) return Boolean; ...appeared somewhere in GNAT. I think that any such declarations written by a user are candidates for pathologies, but if an implementation does it, I'd have to call it malicious. A similar example is single character attribute names. They can seriously mess up the overload resolution code. But of course, implementors deal with that problem by just never declaring single character attribute names. >>What is the expected type of "=" above? > > Boolean. Not sure what you mean... That is the expected result type. What is the expected type of the parameters? As I said, I am now convinced that if there is another candidate "=" declaration, possibly defined by the implementation, then that counts as a bug. > 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. > I'm still a bit concerned about this, since the two cases combined in 4.5.2(6) are significantly different. (The rule about limited types applies to both truly limited types and limited views. However anonymous access types never have re-emerging "=" operators. But I now think that since you can't pass an anonymous access type as a generic formal, there is no real harm done. >>... 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. My concern was really that it applies to limited views. Sometimes you do have "=" operations for limited types that have to be considered in overload contexts. But I am now convinced, as I said above, that views of anonymous access types which have equality operations are pathological. (I could probably be talked into voting for a change which eliminated the pathology, but I now think it only makes sense as a part of the other Ada OY changes--if the changes otherwise make it easier for users to shoot themselves in the foot. -- 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