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,9b7d3a51d0d8b6ee X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j38g2000yqa.googlegroups.com!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Extending discriminant types Date: Thu, 20 Nov 2008 00:30:16 -0800 (PST) Organization: http://groups.google.com Message-ID: <26f0cb8c-eb3e-4c0d-85d1-f45e2c1ba4c6@j38g2000yqa.googlegroups.com> References: <20081115101632.5f98c596@cube.tz.axivion.com> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1227169817 21926 127.0.0.1 (20 Nov 2008 08:30:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 20 Nov 2008 08:30:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j38g2000yqa.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.2.3963) Xref: g2news2.google.com comp.lang.ada:3675 Date: 2008-11-20T00:30:16-08:00 List-Id: On 20 Nov., 08:21, a...@anon.org (anon) wrote: > Since, the orginal post suggest that the poster was using GNAT Ada 95 > compiler. Because the poster states that he can compiler the code. So, > I used Gnat 3.15p using Ada 95 specs. > > Plus, the RM does not limited the "Base" attribute to only Scalar Types. > Any defined type can use the "Base" attribute. Wrong, it does. Please see the RM. You can take the 95 version, the 95 consolidated version, or the 2005 version. They all show you that 'Base is valid for scalar types only. In my last post, I gave you chapter and verse, I repeat it here: K (17). This refers back to 3.5 Scalar Types, especially 3.5(15). Form the kind of reference, you can deduce that there has been no change since the very first publication of Ada 95. [Reference is in the form C.V(p), where p is the paragraph number, here 15. It is adorned with /1, if this paragraph was changed in the consolidated version; with /2, if it was changed in the 2005 version.] So here you see no change. > Then you also have RM 2005 3.8.1 (17). This is irrelevant in this context. > -- > -- This specification was found on Ada-auth.org web site. > -- > package U is > =A0 type T is tagged private ; > > =A0 function "=3D" ( Left, Right : T'Base ) return Boolean ; > > private > =A0 type T is tagged null record ; > end U ; Hm, then this should never have compiled - GNAT is in error here (I guess there are mistakes in every compiler on the world). > the previous code is valid in Ada 95 but will not compile using GNAT > Ada 2005 (2007 or 2008 versions). OK, AdaCore have corrected the bug. > And since a few here, like the "wiki" web sites: > > From: =A0 =A0 =A0 =A0http://en.wikibooks.org/wiki/Ada_Programming/Types Please note that wiki has no normative force. You always have to be suspicious about the contents. You have a good example here. The chapter is partly wrong! Now it was me who wrote lots of the stuff you quote here, so I'm the culprit. I wrote the chapter with scalar types in mind - and in fact, all this is true only for scalar types, not for composite types.