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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!50g2000hsm.googlegroups.com!not-for-mail From: amado.alves@gmail.com Newsgroups: comp.lang.ada Subject: Re: Self pointer in limited record Date: Fri, 31 Aug 2007 16:47:29 -0000 Organization: http://groups.google.com Message-ID: <1188578849.187422.280620@50g2000hsm.googlegroups.com> References: <1183577468.034566.57830@n60g2000hse.googlegroups.com> NNTP-Posting-Host: 212.54.135.10 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1188578849 12685 127.0.0.1 (31 Aug 2007 16:47:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 31 Aug 2007 16:47:29 +0000 (UTC) In-Reply-To: <1183577468.034566.57830@n60g2000hse.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 ebox-adsl.critical.pt:3128 (squid/2.5.STABLE13) Complaints-To: groups-abuse@google.com Injection-Info: 50g2000hsm.googlegroups.com; posting-host=212.54.135.10; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1627 Date: 2007-08-31T16:47:29+00:00 List-Id: On 4 Jul, 20:31, Maciej Sobczak wrote: > Consider: > > type T_Access is access all T; > type T is new Ada.Finalization.Limited_Controlled with record > Self: T_Access := T'Unchecked_Access; > -- more components > -- ... > end record; > > I have seen this pattern repeatedly. 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; But the compiler will remind you that Unchecked_Access is not available for types. (It seems Ada is like most women: unnecessarily complicated and difficult :-)