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,2153d570c2f03e29 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.97.198 with SMTP id ec6mr1055440wib.5.1355972566395; Wed, 19 Dec 2012 19:02:46 -0800 (PST) Path: l12ni162481wiv.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin3!goblin2!goblin.stu.neva.ru!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Question about library-level functions Date: Sun, 16 Dec 2012 09:43:41 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="2a5d6fb105b6730bdbc5ec48c6e18f59"; logging-data="6209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TeZf2qoDxWNI5ISe/vJUYCUjJ8sMQRSc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:JaokhIyr1keFpARx/X/J41LmBKk= sha1:wAFHE0jvbq3zo041Xx2qbcscdaA= Content-Type: text/plain Date: 2012-12-16T09:43:41+00:00 List-Id: ytomino writes: > function alloc return access lifetime.T is > begin > return new lifetime.T'(lifetime.Create); > -- lifetime.Finalize may be called here > end alloc; I think that what's happening is that a (limited) temporary lifetime.T object is created (on the heap, or perhaps the secondary stack). Its access is taken for the return value, and then (because we're leaving the scope) it gets finalized. Whether this is what's meant to happen I don't know!