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: a07f3367d7,545a08a159900a97 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type Date: Thu, 13 Aug 2009 09:16:29 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <8442c52d-805f-4ca8-95ab-b4c8e949d7cd@k6g2000yqn.googlegroups.com> <17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com> <4a83cc73$0$6272$4f793bc4@news.tdc.fi> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1250169389 13764 192.74.137.71 (13 Aug 2009 13:16:29 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 13 Aug 2009 13:16:29 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:w89iJH2cl/gxMJMKDHJpYjy+KUc= Xref: g2news2.google.com comp.lang.ada:7733 Date: 2009-08-13T09:16:29-04:00 List-Id: Niklas Holsti writes: > Randy Brukardt wrote: >> A quick example: >> package P is >> type Priv is private; >> type Acc is access all Priv'Class; -- Legal!!!!!! >> private >> type Priv is tagged null record; >> end P; > > This conflicts with 7.3.1(9) because Priv'Class is used before the > private part. Gnat (Debian Lenny) says: > > p.ads:3:27: tagged type required, found private type "Priv" defined at > line 2 > > If the declaration of type Acc is moved below "private", Gnat accepts > the code, as it should by 7.3.1(8-9). I agree with Niklas. The above is illegal. The purpose of the rule is so you can create recursive types, as in: package P is type Priv is private; private type Acc is access all Priv'Class; -- Legal!!!!!! type Priv is tagged record Next : Acc; ... --etc. end record; end P; without exposing the taggedness to clients. Note that Acc is in the private part, so there's no privacy-breaking going on. - Bob