comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type
Date: Wed, 12 Aug 2009 20:50:47 -0500
Date: 2009-08-12T20:50:47-05:00	[thread overview]
Message-ID: <h5vrjq$l6p$1@munin.nbi.dk> (raw)
In-Reply-To: 17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

"Adam Beneschan" <adam@irvine.com> wrote in message 
news:17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com...
>On Aug 1, 11:55 pm, Hibou57 (Yannick Duch�ne) <yannick_duch...@yahoo.fr> 
>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. But 
there is an ACATS test for it, so it probably will work in your favorite 
compiler...and thus we were unwilling to take it out (somebody probably 
depends on it, and forcing a switch to a tagged private type would have 
other consequences making it not necessarily a trivial work-around).

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;

                                   Randy.






  parent reply	other threads:[~2009-08-13  1:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02  6:55 Ada 95 and Class attribute for none-tagged incomplete type Hibou57 (Yannick Duchêne)
2009-08-03 15:26 ` Adam Beneschan
2009-08-03 18:45   ` Dmitry A. Kazakov
2009-08-13  1:50   ` Randy Brukardt [this message]
2009-08-13  8:18     ` Niklas Holsti
2009-08-13 13:16       ` Robert A Duff
2009-08-14  4:21         ` Randy Brukardt
2009-08-14 19:01           ` Robert A Duff
2009-08-14 23:41             ` Randy Brukardt
2009-08-15 14:33               ` Robert A Duff
2009-08-14  4:17       ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox