comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Extending a type and Finalization
Date: Fri, 5 Jun 2009 07:48:52 -0700 (PDT)
Date: 2009-06-05T07:48:52-07:00	[thread overview]
Message-ID: <b7cee830-10ad-4a1a-a152-311782cf040a@t10g2000vbg.googlegroups.com> (raw)
In-Reply-To: cdg604olt56l$.gpep3ypgnv35.dlg@40tude.net

On Jun 5, 2:11 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> >> I am not sure if this pattern is safe. What gives a guaranty that other
> >> components of TT are initialized before the Initialize gets called on
> >> Control and finalized after the Finalize gets called?
>
> > RM 7.6(12)
>
> Then it should rather be:
>
>     type TT is new P.T with record
>        ...
>        Control : Control_Type (TT'Access);  -- The last component
>     end record;

No; the rule I cited makes certain that components with self-
referential access discriminant constraints are always initialized
last and finalized first, regardless of whether they appear before or
after other components in the extension part.  (Order matters only
when you have more than one component that has a discriminant
constraint like this.)

                              -- Adam




  reply	other threads:[~2009-06-05 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 17:45 Extending a type and Finalization pascal.malaise
2009-06-04 18:00 ` Hibou57 (Yannick Duchêne)
2009-06-04 19:33   ` Adam Beneschan
2009-06-04 20:06     ` Dmitry A. Kazakov
2009-06-04 21:18       ` Adam Beneschan
2009-06-05  9:11         ` Dmitry A. Kazakov
2009-06-05 14:48           ` Adam Beneschan [this message]
2009-06-05 17:15             ` Dmitry A. Kazakov
2009-06-05 11:29     ` malaise
2009-06-05 12:21       ` Ludovic Brenta
2009-06-05 13:02         ` malaise
2009-06-05 13:14           ` Ludovic Brenta
2009-06-05 13:32             ` malaise
2009-06-15  6:30 ` AdaMagica
replies disabled

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