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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!t10g2000vbg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Extending a type and Finalization Date: Fri, 5 Jun 2009 07:48:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <303a64d4-2fdd-47fe-ae4b-3ddf1912cffe@f19g2000yqh.googlegroups.com> <02bb50df-d833-4b08-8f12-a3b10d7dcd78@n8g2000vbb.googlegroups.com> <1weng8cyxd5bf$.19oxow5s49g48$.dlg@40tude.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244213333 7930 127.0.0.1 (5 Jun 2009 14:48:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 5 Jun 2009 14:48:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t10g2000vbg.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6307 Date: 2009-06-05T07:48:52-07:00 List-Id: On Jun 5, 2:11=A0am, "Dmitry A. Kazakov" wrote: > >> I am not sure if this pattern is safe. What gives a guaranty that othe= r > >> 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: > > =A0=A0 =A0type TT is new P.T with record > =A0=A0 =A0 =A0 ... > =A0=A0 =A0 =A0 Control : Control_Type (TT'Access); =A0-- The last compone= nt > =A0=A0 =A0end 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