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 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-08 13:04:18 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Language lawyer question: Equality on 'Access attributes Date: 08 Jan 2004 16:04:17 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4LKdnRRNyv6AlmCiRVn-ig@comcast.com> <6bSdnYBKy_diPGCi4p2dnA@gbronline.com> NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1073595857 11438 192.74.137.185 (8 Jan 2004 21:04:17 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 8 Jan 2004 21:04:17 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:4228 Date: 2004-01-08T16:04:17-05:00 List-Id: Ze Administrator writes: > Robert A Duff wrote: > >>3.10.2(24), X'Access does *not* necessarily return any sort of type > >>implicitly defined by the language (for which no comparison operations > >>would be defined). The wording of this clause is: > >> > >> The type of X'Access is an access-to-object type, as determined by > >> the expected type. > >> > >>The way I read this is that the type of X'Access is the expected type, > >>which could be a program-defined type, which *would* have comparison > >>operations defined for it. First of all, I didn't write the above. Note the number of ">"'s. > I'd rather agree with Robert Eachus. If 'X' and 'Y' are > both Integers, then X'Access obviously has to be a named > or anonymous type that is an access Integer. Problem is, > there could be a dozen named types visible at that point > which are defined that way. In which case, there would be many "=" operators visible, and the expression would be ambiguous. >...Some of them could be limited. There's no such thing as a limited access type. ;-) Probably there should be, but that's another story! > You are asking the compiler to arbitrarily pick any visible > non-limited 'access Integer' type, and use it for the comparison. No. If there are more than one "=" visible that take access-to-integer, then it would be ambiguous. In the example given, there was only one such "=". The point is, resolution of "=" is just like any other subprogram. There's no question of "arbitrarily picking" a type. For one thing, the compiler is picking an "=" function, not a type. And for another thing, the compiler is *not* expected to think, "well, all those = operators are basically the same thing anyway, so I'll just pick one arbitrarily". If you don't believe this is what the RM says (which was the original question), you should quote chapter and verse. (I admit that this is a subtle area -- I could be wrong.) On the other hand, if you don't *like* what the RM says, please explain why "=" should behave differently from other subprograms. Note that various features *do* behave differently. For example, as was pointed out by somebody, there's a special rule for type conversions. But "=" is just a function -- sometimes predefined, sometimes user defined, so what matters is how many are visible, with what parameter and result types (and, I claim, that's probably a good thing). - Bob