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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b7d3a51d0d8b6ee X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2!wn11feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Extending discriminant types Reply-To: no to spamers (No@email.given.org) References: <20081115101632.5f98c596@cube.tz.axivion.com> <3f77e490-2f54-4441-828e-6c6e68d245df@a17g2000prm.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Fri, 21 Nov 2008 07:25:27 GMT NNTP-Posting-Host: 12.65.30.98 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1227252327 12.65.30.98 (Fri, 21 Nov 2008 07:25:27 GMT) NNTP-Posting-Date: Fri, 21 Nov 2008 07:25:27 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:2724 Date: 2008-11-21T07:25:27+00:00 List-Id: Adam, Try an explain this. Since I downloaded my binary version of GNAT-3.15p direct from Adacore. And someone else has said the GNAT-3.15p is old but it has been fully tested and found to be correct. So, that means that time Adacore agreed that "Base" attribute could be used outside of scalars and that was years after the RM and AARM for Ada 95 was written. Now, both in the AARM 95 and AARM 2005. contains a section 3.2.3 (8.a) beside yoyur (63.a): quote Incompatibilities With Ada 83 8.a {incompatibilities with Ada 83} The attribute S'Base is no longer defined for non-scalar subtypes. Since this was only permitted as the prefix of another attribute, and there are no interesting non-scalar attributes defined for an unconstrained composite or access subtype, this should not affect any existing programs. unquote First, there is a "interesting non-scalar attributes defined for an unconstrained composite or access subtype", it used in "Object-oriented programming" (OOP). But back in 90s, Ada was a late starter for OOP and even with the Ada 2005 OOP extensions some might still say its late to the plate or should that be table. Secondly, there is another side to 3.2.3 (8.a) and others listed in the AARM, and that is the clarifying statement "incompatibilities with Ada 83". But that does not say that "X'Base" or "T'Base" can not exist. If that was the case, a form of this statement would also be listed in "Annex J: Obsolescent Features" of the official RM. In my example the syntax for "Base" attribute would be more like: T'Base T'Base denotes an unconstrained subtype of the type of T also called the base subtype of the type T. and not "S'Base". In <3f77e490-2f54-4441-828e-6c6e68d245df@a17g2000prm.googlegroups.com>, Adam Beneschan writes: >On Nov 20, 2:59 pm, a...@anon.org (anon) wrote: >> First, the second specification package that I use was written by >> "Pascal Leroy". another editor of the Ada 2005 RM. "Randy Brukardt" >> skip this topic. >> >> QUOTE >> Our compiler currently rejects the following code fragment because it >> complains that the overriding "=" is not subtype conformant with the >> inherited "=" (3.9.2(10)): >> >> package P is >> type T is tagged private; >> function "=" (Left, Right : T'Base) return Boolean; >> private >> type T is tagged null record; >> end P; >> >> T is a constrained subtype as per 3.2(9), so as far as I understand, T is >> different from the "T italic" used in 4.5.2(7). >> >> I hope that there is flaw in my reasoning, because if it is correct, it >> looks like we have a pretty severe problem... >> >> Pascal >> UNQUOTE >> >> And since both RM 95 and RM 2005, do not clarify that the "Base" attribute >> is for scalar types only, then you must assume that the "Base' attribute >> can apply to other types as well. > >The Annotated Ada Reference Manual does clarify this, though. See >AARM 3.5(63.a). http://www.adaic.org/standards/05aarm/html/AA-3-5.html > > > Else either "Pascal Leroy" or may be >> "Randy Brukardt" would have correct the misunderstanding of this >> attribute, especially since, Pascal implied the understanding in the >> first place by use of his example. > >Either that, or both Pascal and Randy are human and both erred by >missing the problem. It happens. > > -- Adam