comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type
Date: Thu, 13 Aug 2009 11:18:47 +0300
Date: 2009-08-13T11:18:47+03:00	[thread overview]
Message-ID: <4a83cc73$0$6272$4f793bc4@news.tdc.fi> (raw)
In-Reply-To: <h5vrjq$l6p$1@munin.nbi.dk>

Randy Brukardt wrote:
> "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.

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
       .      @       .



  reply	other threads:[~2009-08-13  8:18 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
2009-08-13  8:18     ` Niklas Holsti [this message]
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