comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: limited /non-limited tagged type
Date: Sat, 05 Mar 2011 02:29:57 +0100
Date: 2011-03-05T02:29:57+01:00	[thread overview]
Message-ID: <4d719215$0$7653$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <7624bb22-805e-4e88-ba6c-debae289f883@z31g2000vbs.googlegroups.com>

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.






  reply	other threads:[~2011-03-05  1:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04 18:56 limited /non-limited tagged type Hacid
2011-03-04 19:54 ` Edward Fish
2011-03-04 21:18   ` Hacid
2011-03-05  0:17     ` Edward Fish
2011-03-04 20:10 ` Georg Bauhaus
2011-03-04 21:55   ` Hacid
2011-03-04 22:21     ` Hacid
2011-03-05  1:20       ` Randy Brukardt
2011-03-04 22:22     ` Georg Bauhaus
2011-03-04 22:40       ` Hacid
2011-03-05  1:29         ` Georg Bauhaus [this message]
2011-03-04 23:34 ` Adam Beneschan
2011-03-05  3:26 ` Adam Beneschan
2011-03-05 16:48   ` Hacid
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox