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: 103376,2586a992fd399bf8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!news2.euro.net!newsfeed.freenet.ag!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 05 Mar 2011 02:29:57 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110123 Thunderbird/3.1.8 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: limited /non-limited tagged type References: <40bfb845-7868-4536-886b-496e8dc82cb4@hd10g2000vbb.googlegroups.com> <4d714736$0$6979$9b4e6d93@newsspool4.arcor-online.net> <9e7a23dd-883c-46fa-88a4-b0ce9aab529d@r4g2000vbq.googlegroups.com> <4d716634$0$6975$9b4e6d93@newsspool4.arcor-online.net> <7624bb22-805e-4e88-ba6c-debae289f883@z31g2000vbs.googlegroups.com> In-Reply-To: <7624bb22-805e-4e88-ba6c-debae289f883@z31g2000vbs.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d719215$0$7653$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 05 Mar 2011 02:29:57 CET NNTP-Posting-Host: 06f6a7c3.newsspool1.arcor-online.net X-Trace: DXC=_CTO9j@4?lOj7E:bke<5HFic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBMBHNc?NkSHNPCY\c7>ejVHRb>^e;]TfjGF^Y]JTmWkCO X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:18833 Date: 2011-03-05T02:29:57+01:00 List-Id: On 3/4/11 11:40 PM, Hacid wrote: >> private generic >> type Element is new Object with private; >> package Foo_3.Pools is >> >> Foo_3.Copy can then effectively be called from within >> Foo_3.Pools.Copy. > > > I have no compilation error on my file foo_3-pools.adb. > But this construction make only a partial copy of the derivated > element. > And I would want a full one. That was what I tried to explain...but I > am not very understandable in English :o) I should wait until you have answered Adam's comments. Nevertheless, an important distinction might be whether - Element is your derived type - Someone else's In the first case, it is all your Copy operation having access to all fields of Element. If Element is all yours, then I don't see how proper nesting of your Copy procedures might miss a component: Premises IIUC === - The publicly limited objects live in arrays, - It will be OK to overwrite all object data privately, per object, as long as the data is written by your own Copy procedure, and not by someone else's. Then your private Copy procedures could invoke any parent's private Copy procedure (assuming all Copy procedures in the derivation hierarchy can be called by yours). This will copy all record components of the parent's view of the object. When the parent's copy is done, Copy copies the remaining components.