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-Thread: 103376,461276586f65363c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i39g2000cwa.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Predefined equality, reemergence Date: 5 Apr 2006 11:47:17 -0700 Organization: http://groups.google.com Message-ID: <1144262837.486161.27060@i39g2000cwa.googlegroups.com> References: <1144179013.753791.169830@u72g2000cwu.googlegroups.com> <1144179981.495938.321410@e56g2000cwe.googlegroups.com> <1144195041.057113.231640@t31g2000cwb.googlegroups.com> <1144239394.052533.214270@t31g2000cwb.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1144262842 17226 127.0.0.1 (5 Apr 2006 18:47:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 5 Apr 2006 18:47:22 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i39g2000cwa.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news1.google.com comp.lang.ada:3731 Date: 2006-04-05T11:47:17-07:00 List-Id: christoph.grein@eurocopter.com wrote: > Adam wrote: > "Reading this section closely, it appears that if the actual > type for T is ACT, and ACT is a tagged record type, and there is a > user-defined primitive operator "=" on ACT, then: if ACT is a private > type, the predefined "=" is the user-defined "=" (4.5.2(15)), but if > ACT is not a private type, the user-defined "=" isn't used" > > I think you misread this sentence. It says: For a private type, it > depends on whether the full type is tagged or not. > If it is tagged, the primitive equality is used, else the predefined > equality is used. > > So the result is: For tagged types (whether visibly tagged or not), > predefined equality when overridden is lost forever. I don't get how this result follows from the sentence in 4.5.2(15). That sentence appears to talk about private types, but appears to say nothing at all about non-private types. In my example, 12.5(8) tells us we need to find out what predefined equality is for the actual type, and since the actual type isn't a private type, 4.5.2(15) would appear not to apply at all. Or is your last statement still speaking only about private types? Anyway, I can understand your statement that when an overriding "=" is provided for a tagged type, the predefined "=" may no longer reemerge. It just appears to me that there's an unintended loophole in the language that makes this statement false in some instances---12.5(8) says that "=" on a generic formal type refers to the predefined equals operator on the actual, and there's nothing that says that the predefined "=" on a tagged type T *is* *always* the overriding "=" operator if there is one. 4.5.2(24) says this is the case for a *component* of type T, when you're using "=" on a larger object that contains such a component; but it doesn't say that it's the case when you're comparing objects of type T that are not components. I'm prepared to accept that this is just an omission in the RM, and that the predefined "=" never reemerges for tagged types. That would satisfy me; it answers my original question and convinces me that the output of my example should be TRUE in both cases. It still seems to me that the RM is a bit vague on the question of what 12.3(16) and 8.3(13) say about the *body* of the implicit "=" on Rec (in my example) that gets copied when instantiating. -- Adam