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: a07f3367d7,57f8540942f8e060 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!w27g2000pre.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Initialization and Finalization of limited object "returned" by a function Date: Thu, 11 Feb 2010 15:41:42 -0800 (PST) Organization: http://groups.google.com Message-ID: <22770615-78cf-43eb-a817-0af52ddece6a@w27g2000pre.googlegroups.com> References: <75a9f860-ad3c-49a0-b2a1-a8f1386e6ff6@x10g2000prk.googlegroups.com> 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 1265931703 16943 127.0.0.1 (11 Feb 2010 23:41:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 11 Feb 2010 23:41:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w27g2000pre.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: g2news1.google.com comp.lang.ada:9129 Date: 2010-02-11T15:41:42-08:00 List-Id: On Feb 11, 2:53=A0pm, Robert A Duff wrote: > It doesn't matter whether the result object has a name or not. > What matters is whether it's limited -- in the limited case, > the result object is NOT finalized when leaving the function. But that's true even if it's nonlimited, right? If NLT is non- limited, and you say (inside function NLT_Func) return X : NLT do X.Component :=3D ... end return; X, which is now another name for the "anonymous result object" created for the function call, is not finalized "when leaving the function". It's finalized later. If you say Y : NLT :=3D NLT_Func(...); it's finalized after being copied to Y (assuming it is not built in place). If you pass the result to some other function(s): Z : Type2 :=3D Func2 (Func3 (NLT_Func (...))); then I believe the result object (of NLT_Func) is not finalized until after the entire expression is evaluated, right? -- Adam