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!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How can one record component be local and another not? Date: Thu, 7 May 2020 13:15:05 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net c4YCJRz1lOmytAIF+Jv2TQ2dl6MCCUAjLAOpqKB2hAnmAOCmp5 Cancel-Lock: sha1:NTiR8jkaH8P2hBKoEYLcndxvyC8= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58623 Date: 2020-05-07T13:15:05+03:00 List-Id: On 2020-05-07 12:07, J-P. Rosen wrote: > Le 06/05/2020 à 19:30, Niklas Holsti a écrit : >> Note that, although "Test" here is no doubt the program's main >> subprogram and so its call (assuming it is not recursive) lasts almost >> as long as the execution of the program, the compiler does not make use >> of this fact to determine the life-times of types and objects in "Test". > > No, tasks declared in library packages could survive the main program. And the environment task, yes. I know, which is why I said "almost as long as". The example program we were discussing had no library tasks. > You may even have a "begin null; end" main program, and do all the work > with library tasks. Yes, but not for this example program. But I should have been clearer, I admit. > Moreover, there is no rule in Ada that makes the main subprogram "special". Indeed, I was trying to make that point, but evidently not clearly enough. Sometimes this is a little annoying, where one wants to write a small program with some library-level stuff, but must then separate those declarations into a package. An option to have a "main package" instead of a "main subprogram" would sometimes be neat (and now somebody will tell me that Gnat already has that...) -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .