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-10 08:37:11 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!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: Sat, 10 Jan 2004 10:37:09 -0600 Date: Sat, 10 Jan 2004 11:37:08 -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> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <78OdnX7je6Oot53d4p2dnA@comcast.com> NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-FNJnVGTMNfb77qvby/WZnxvsckDQzWKcckkckcopJVJQaKPvJpOqk5hbCxOVO8cv8VOP4K+VPkGc2ce!pTQfz37dfNEPpoeqMuZV/0lWVtHn2FP/E+mf1EDghZN0TjpWjg8yeZ57/vOBww== 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:4310 Date: 2004-01-10T11:37:08-05:00 List-Id: Randy Brukardt wrote: > "Robert I. Eachus" wrote in message > news:XridndndEa-m2mOiRVn-hQ@comcast.com... > ... > >>The technical question is how many "=" operations could apply in this >>case. My contention was that there are at least two, one associated >>with the 'Access attributes (actually I think there is one for each >>attribute) and one declared by the user. > > Huh? There is nothing in the RM about types being declared by 'Access. The > only way to get an anonymous access type is via an access_definition, as in > a parameter. And anonymous access types don't even have their own "=", see > 4.5.2(6) "...for every type T that is not limited, and is not an anonymous > access type." Yeah, I goofed when I wrote the part you quoted. (I should never play language lawyer after midnight.) But I am still convinced that there is an issue here. If there are anonymous access Integer types around, it is not clear to me that they can be ignored during overload resolution. Let me reiterate that I am not saying that a compiler that concludes the example program is legal are wrong. Far from it. But I am saying that GNAT's interpretation may also be correct, and it may depend on whether or not the implementation (or the user) defines an access Integer parameter somewhere. Visibility of predefined "=" (and other predefined operators) is a best described by first pointing at RM 8.3(29) (which is a note): "Not all contexts where an identifier, character_literal, or operator_symbol are allowed require visibility of a corresponding declaration. Contexts where visibility is not required are identified by using one of these three syntactic categories directly in a syntax rule, rather than using direct_name or selector_name." Now look at RM 4.5(1..7): "The language defines the following six categories of operators (given in order of increasing precedence). The corresponding operator_symbols, and only those, can be used as designators in declarations of functions for user-defined operators..." A similar problem occured in Ada83 with "for I in -1..10;" (or other similar constructs). Even if there was only one predefined integer type, the existance of Count in Text_IO made the "-" operator ambiguous, even if there was no with for Text_IO. This issue was fixed in Ada 95 by 8.6(29). I certainly agree that my interpretation is not one that I am comfortable with. I am also not sure that I like all of the ramifications of the other/majority interpretation. > Ada 200Y probably will change this slightly; we've spent a lot of ARG > time looking at this area because we want to expand the places that > anonymous access types can be used. It is probably not worth a separate BI at this point, but fixing the relevant wording should be rolled into Ada0Y. (I've never liked the wording of RM 8.6 (20..25) anyway. ;-) -- 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