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: 103376,5c89acd494ea9116 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!62.111.101.3.MISMATCH!news.germany.com!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Self pointer in limited record 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: <1183577468.034566.57830@n60g2000hse.googlegroups.com> <1188578849.187422.280620@50g2000hsm.googlegroups.com> Date: Fri, 31 Aug 2007 21:33:05 +0200 Message-ID: <9fy1xoukz1e3$.h574sqmiauri$.dlg@40tude.net> NNTP-Posting-Date: 31 Aug 2007 21:32:46 CEST NNTP-Posting-Host: 41dc8edd.newsspool4.arcor-online.net X-Trace: DXC=3MMWW2D0H=SmG86`U=_nC_4IUK On Fri, 31 Aug 2007 16:47:29 -0000, amado.alves@gmail.com wrote: > Then you have seen illegal Ada code repeatedly. I wish this were > possible myself. Or more simply: > > type T is -- limited or not > Self : access T := T'Unchecked_Access; > ... > end; T cannot be non-limited, because otherwise passing it by copy would make rubbish out of Self. In any case it would make little sense if not access T'Class. -------------- There is an interesting illegal case of objects bound to a specific storage pool: type T is tagged limited private; private type T_Ptr is access T'Class; for T_Ptr'Storage_Pool use ...; type T is tagged limited record Self : T_Ptr := T'Unchecked_Access; -- Illegal end record; The language requires T_Ptr to be a general access type no matter what. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de