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!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!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: Fri, 14 Aug 2009 15:01:15 -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 1250276477 14175 192.74.137.71 (14 Aug 2009 19:01:17 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 14 Aug 2009 19:01:17 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:GllOsCB/KjSmiJg1/7e0o1/5fA4= Xref: g2news2.google.com comp.lang.ada:7800 Date: 2009-08-14T15:01:15-04:00 List-Id: "Randy Brukardt" writes: >...All this special rule eliminates is the need to declare > an incomplete type in this one unusual case (the private type in cases like > this is best declared as tagged, so this shouldn't happen very often). Seems > like a pile of work for an implementation and for the language just to > eliminate one line in a private part. The problem is that declaring that incomplete type is illegal. Eliminating the need for one _illegal_ line isn't such a bad thing. ;-) package P is type Priv is private; private type Priv is tagged; -- Illegal! type Acc is access all Priv'Class; type Priv is tagged record Next : Acc; end record; end P; We could have made it legal, I suppose. But having three views of a type might make more trouble for the compiler than the existing rules. On the third hand, compilers have to deal with: package P is type Priv is private; private task type Priv is ...; end P; package body P is task body Priv is separate; end P; separate (P) task body Priv is ...; where there are four things called Priv, which are all really the same thing. - Bob