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 Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!feeder.erje.net!195.197.54.118.MISMATCH!feeder2.news.elisa.fi!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Date: Thu, 13 Aug 2009 11:18:47 +0300 From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type References: <8442c52d-805f-4ca8-95ab-b4c8e949d7cd@k6g2000yqn.googlegroups.com> <17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4a83cc73$0$6272$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 81.17.205.61 X-Trace: 1250151539 news.tdc.fi 6272 81.17.205.61:56556 X-Complaints-To: abuse@tdcnet.fi Xref: g2news2.google.com comp.lang.ada:7712 Date: 2009-08-13T11:18:47+03:00 List-Id: Randy Brukardt wrote: > "Adam Beneschan" wrote in message > news:17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com... >> On Aug 1, 11:55 pm, Hibou57 (Yannick Duch�ne) >> wrote: >>> Hello, >>> >>> I've learned something mostly surprising today : in Ada 95, this was >>> allowed to use the Class attribute with a prefix which was an >>> incomplete type.... even not tagged. > > Gee, guys, that's pretty boring. If you want something mind blowing in this > area, look into 7.3.1(8-9) > (http://www.adaic.org/standards/05rm/html/RM-7-3-1.html). > > More than 90% of the ARG (that is, everyone other than Tucker, and he only > had a vague recollection of it) was unaware of this rule when I stumbled > across it updating notes. And no one can remember why we would want such a > rule - it seems completely privacy breaking, and for no good reason. I don't understand -- 7.3.1(9) says (both in RM 95 and RM 05) that the 'Class attribute is "allowed only from the beginning of the private part in which the full view is declared..." > 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). -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .