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!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Initialization and Finalization of limited object "returned" by a function Date: Thu, 11 Feb 2010 10:16:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1265901399 9446 192.74.137.71 (11 Feb 2010 15:16:39 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 11 Feb 2010 15:16:39 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:b2UM+4Bb5YKykHTBiffV4E6dL3U= Xref: g2news1.google.com comp.lang.ada:9110 Date: 2010-02-11T10:16:46-05:00 List-Id: "Hibou57 (Yannick Duch�ne)" writes: > What a surprise to me to experience something different : limited > object Finalized right after Initialization. I'm not going to read your code carefully, but that doesn't seem right. If you have: X : T := F(...); the result of F is "built in place" in X, and should be finalized when the procedure containing X is left. Here is some more info about limited function returns: http://www.adacore.com/2007/09/24/ada-gem-10/ and 2 following gems. > function New_A return A_Type is > begin > return Result : A_Type do > null; > end return; You can say "return Result : A_Type;" here. - Bob