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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2c1aef7e0a2350d1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!a7g2000yqk.googlegroups.com!not-for-mail From: malaise@magic.fr Newsgroups: comp.lang.ada Subject: Re: Extending a type and Finalization Date: Fri, 5 Jun 2009 06:32:01 -0700 (PDT) Organization: http://groups.google.com Message-ID: <49d6de3e-7a5a-4e0f-8422-35b625cf9be0@a7g2000yqk.googlegroups.com> References: <303a64d4-2fdd-47fe-ae4b-3ddf1912cffe@f19g2000yqh.googlegroups.com> <02bb50df-d833-4b08-8f12-a3b10d7dcd78@n8g2000vbb.googlegroups.com> <5dbd97d8-ab49-4316-b531-23b28fc2af7b@k8g2000yqn.googlegroups.com> <3d991397-94e5-4dd5-8712-a1fe5b1d234c@t21g2000yqi.googlegroups.com> NNTP-Posting-Host: 192.54.144.229 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1244208721 26172 127.0.0.1 (5 Jun 2009 13:32:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 5 Jun 2009 13:32:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a7g2000yqk.googlegroups.com; posting-host=192.54.144.229; posting-account=52eKqgoAAADWCuSusv9knR2f_28-NAV2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.6) Gecko/20060728 (CK-Thales) Firefox/1.5.0.6,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6304 Date: 2009-06-05T06:32:01-07:00 List-Id: On 5 juin, 15:14, Ludovic Brenta wrote: > Pascal Malaise wrote on comp.lang.ada: > > > Thank you Ludovic. Solution 2 is fine for me. > > > Concerning your recommendation, I think that the following is > > compliant, or did I misunderstand something? > > type T is new Ada.Finalization.Controlled with record > > I : Integer; > > end record; > > end P; > > No, that complies with Dmitry's recommendation but not with mine or > Jeffrey's. I prefer and recommend composition unless there is a > compelling reason to use type extension. Adam's post earlier in this > thread describes the composition approach. > > -- > Ludovic Brenta. I need to make visible that T is an extension of Controlled (as we have seen earlier). I want to hide, make private, the component I of T. So the only solution I see is (but this is not a complelling reason): type T is new Ada.Finalization.Controlled with private; private type T is new Ada.Finalization.Controlled with record I : Integer; end record;