comp.lang.ada
 help / color / mirror / Atom feed
* Q Controlled Types
@ 1997-06-05  0:00 Guido Schumacher
  1997-06-06  0:00 ` Anonymous
  1997-06-06  0:00 ` Mark A Biggar
  0 siblings, 2 replies; 6+ messages in thread
From: Guido Schumacher @ 1997-06-05  0:00 UTC (permalink / raw)



Is there a possibility to distinguish two different kinds of situations
in which Finalize can be called from within the body of Finalize?
In other words, is it possible to treat the finalization of an object differently,
depending on the context in which it is performed?
1. Calling of Finalize as part of an assignment operation
2. Finalize is called before the object is destroyed (and no copy is performed)

declare
  V: CT; -- type CT is new controlled with ...
begin 
  ...
  V := E;    -- (1)
  ...
end;         -- (2)

I would appreciate any help.

Thank you

Guido
-- 
Guido Schumacher
Carl von Ossietzky Universitaet Oldenburg
Postfach 2503
26111 Oldenburg
Email: Guido.Schumacher@Informatik.Uni-Oldenburg.de
Tel.: +49 441 798 2370
Fax:  +49 441 798 2145





^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Q Controlled Types
@ 1997-06-13  0:00 Guido Schumacher
  1997-06-14  0:00 ` Robert A Duff
  0 siblings, 1 reply; 6+ messages in thread
From: Guido Schumacher @ 1997-06-13  0:00 UTC (permalink / raw)




Robert A Duff wrote:
>Anonymous <nobody@REPLAY.COM> wrote:
Mark A Biggar wrote:
>>On 5 Jun 1997 19:27:11 GMT, "Guido Schumacher"
>><Guido.Schumacher@Informatik.Uni-Oldenburg.DE> wrote:
>>
>>> Is there a possibility to distinguish two different kinds of situations
>>> in which Finalize can be called from within the body of Finalize?
>>> In other words, is it possible to treat the finalization of an object differently,
>>> depending on the context in which it is performed?
>
>I'm curious.  Why do you want to do this?
My intention is to preserve information of a target object in an assignment. The
information (containing a protected object) is stored in an object which can be accessed by an access type. 
A pointer of that access type is a record component of the controlled type.
If it were obvious that a call of finalize is not part of an assignment it would be possible to deallocate the object containing the static information.
The controlled object and the static object would both have the same lifetime.

>>In a word, "No."
>
>Agreed.
>
>>Should someone prove me wrong, I'd be interested to learn how to do
>>this.
>
>Not me.  It seems that Finalize doesn't know whether it's called from
>assignment vs at end-of-procedure.

Thank you for the replies.
Guido
-- 
Guido Schumacher
Carl von Ossietzky Universitaet Oldenburg
Postfach 2503
26111 Oldenburg
Email: Guido.Schumacher@Informatik.Uni-Oldenburg.de
Tel.: +49 441 798 2370
Fax:  +49 441 798 2145





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1997-06-14  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-05  0:00 Q Controlled Types Guido Schumacher
1997-06-06  0:00 ` Anonymous
1997-06-07  0:00   ` Robert A Duff
1997-06-06  0:00 ` Mark A Biggar
  -- strict thread matches above, loose matches on Subject: below --
1997-06-13  0:00 Guido Schumacher
1997-06-14  0:00 ` Robert A Duff

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