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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns. Date: Wed, 1 May 2013 21:38:29 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <97967083-d21d-4de2-aeb8-76d0d5818993@googlegroups.com> <03e84773-d616-4a46-8189-93ae4ab5fcbf@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367462318 27647 69.95.181.76 (2 May 2013 02:38:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 2 May 2013 02:38:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:15287 Date: 2013-05-01T21:38:29-05:00 List-Id: On Tuesday, April 23, 2013 9:52:04 AM UTC-7, Simon Wright wrote: > > > The upshot of all this is that, by 7.6.1(4) and 9.3(2), in Make_ER, > > the task created by the allocator *depends* *on* the body of Make_ER, > > and therefore the body of Make_ER cannot complete until the task has > > completed. That should be enough to explain the results. > > Yes, but there are other similar side effects: in the tests, OP wrote > > declare > function Make(Input : in String) return not null access Testing > renames Make_EF; > > P : constant array (Positive range <>) of > not null access constant Testing:= > ( Make("Bob"), Make("Steve"), Make("Dave"), Make("Joey") ); > begin > null; > end TEST_1; > > and the code doesn't exit the declare block until all the tasks have > completed. Adam says: > I don't see a language reason for that. I don't understand. The anonymous access type is declared in the block, as the master of an access return is that of the point of call [it's passed into the function if necessary]. (That's changed in Ada 2012, but the previous definition was nonsense.) That's the master of the allocators. So of course the tasks "belong" to the master of the block, and the block has to wait for them to complete. BTW, I don't think the extended return should be different, but I have no interest in figuring out whether it could or not. It probably depends on exactly how/where the allocator is written. No human can figure these things out, so please don't use them and save the brain of an ARG member. ;-) Randy.