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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news4.google.com!goblin2!goblin.stu.neva.ru!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <8442c52d-805f-4ca8-95ab-b4c8e949d7cd@k6g2000yqn.googlegroups.com> <17b5de2e-74df-414a-b214-677344dc697e@x25g2000prf.googlegroups.com> Date: Mon, 3 Aug 2009 20:45:02 +0200 Message-ID: <7cjtueuadh5r.17j3l3w6zv1s3$.dlg@40tude.net> NNTP-Posting-Date: 03 Aug 2009 20:45:03 CEST NNTP-Posting-Host: f80930ee.newsspool3.arcor-online.net X-Trace: DXC=cf8c]4oe_fdf1oJaJ0@dmgMcF=Q^Z^V3h4Fo<]lROoRa^YC2XCjHcbi@LK^@RU_9dQ^iMW2B_H1S=dn X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7547 Date: 2009-08-03T20:45:03+02:00 List-Id: On Mon, 3 Aug 2009 08:26:24 -0700 (PDT), Adam Beneschan wrote: > Keep in mind that this isn't a privacy issue. The main reason for > incomplete types is so that you can declare linked lists and things > like that. Allowing a 'Class reference to a type not yet declared as > tagged allowed things like this: > > type Rec; > type Rec_Acc is access all Rec'Class; > type Rec is tagged record > ... > Next : Rec_Acc; > end record; > > so that you could have a heterogeneous list of records. Well, I would argue that logically the above could be rather: type Rec; type Rec_Acc is access all Rec; type Rec'Root is tagged record ... Next : Rec_Acc; end record; Here 'Root is defined so that T'Class'Root = T. So Rec is class-wide. Of course, from the stand point that any type has a class rooted in it, Rec'Class is fully OK. But if we wanted further to pretend that some types are more "classy" than others, we could maintain such distinction in a way like above. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de