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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,545a08a159900a97,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!k6g2000yqn.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Ada 95 and Class attribute for none-tagged incomplete type Date: Sat, 1 Aug 2009 23:55:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8442c52d-805f-4ca8-95ab-b4c8e949d7cd@k6g2000yqn.googlegroups.com> NNTP-Posting-Host: 86.66.190.37 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1249196116 14318 127.0.0.1 (2 Aug 2009 06:55:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 2 Aug 2009 06:55:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k6g2000yqn.googlegroups.com; posting-host=86.66.190.37; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7518 Date: 2009-08-01T23:55:16-07:00 List-Id: 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 ?