comp.lang.ada
 help / color / mirror / Atom feed
* Ada 95 and Class attribute for none-tagged incomplete type
@ 2009-08-02  6:55 Hibou57 (Yannick Duchêne)
  2009-08-03 15:26 ` Adam Beneschan
  0 siblings, 1 reply; 11+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-08-02  6:55 UTC (permalink / raw)


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.

I've learned about it here :

http://www.adaic.org/standards/05rat/html/Rat-1-3-3.html
>> ------------------
The introduction of tagged incomplete types clarifies the ability to
write
type T_Ptr is access all T'Class;
This was allowed in Ada 95 even though we had not declared T as tagged
at this point. Of course it implied that T would be tagged. In Ada
2005 this is frowned upon since we should now declare that T is tagged
incomplete if we wish to declare a class wide access type. For
compatibility the old feature has been retained but banished to Annex
J for obsolescent features.
>> ------------------

The part of the mentionned annex J
>> ------------------
For the first subtype S of a type T declared by an
incomplete_type_declaration that is not tagged, the following
attribute is defined:
S'Class
Denotes the first subtype of the incomplete class-wide type rooted at
T. The completion of T shall declare a tagged type. Such an attribute
reference shall occur in the same library unit as the
incomplete_type_declaration.
>> ------------------

But why was it allowed ?
There was no way to declare an incomplete tagged ?
So why to allow reference to a Class attribute in such circumstances ?

This seems weird ... to allow to make reference to a class attribute
of a none-tagged type (even if the complete view is tagged)

Was this a design error or were there some reasons or is there
something I did not understand ?



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-08-15 14:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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