comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: How can one record component be local and another not?
Date: Thu, 7 May 2020 06:00:30 -0700 (PDT)
Date: 2020-05-07T06:00:30-07:00	[thread overview]
Message-ID: <58b57daf-852c-4ff1-a185-e7b23c698cc6@googlegroups.com> (raw)
In-Reply-To: <hhi5d9Fh49hU1@mid.individual.net>

On Thursday, May 7, 2020 at 12:15:07 PM UTC+2, Niklas Holsti wrote:
> 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
>        .      @       .

Since you asked so nicely...

Sort of, 

-z
No main subprogram. Bind and link the program even if the unit name given on the command line is a package name. The resulting executable will execute the elaboration routines of the package and its closure, then the finalization routines.


I believe that's needed for the DSA?

-- 
~egilhh

  reply	other threads:[~2020-05-07 13:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 11:04 How can one record component be local and another not? hreba
2020-05-05 11:33 ` AdaMagica
2020-05-05 11:38   ` AdaMagica
2020-05-05 12:59   ` hreba
2020-05-05 13:19     ` J-P. Rosen
2020-05-05 13:37     ` Jere
2020-05-05 14:28       ` hreba
2020-05-05 15:18         ` AdaMagica
2020-05-05 14:32   ` hreba
2020-05-05 11:43 ` AdaMagica
2020-05-05 12:55   ` hreba
2020-05-05 11:46 ` Simon Wright
2020-05-05 13:07   ` hreba
2020-05-05 17:00     ` Dmitry A. Kazakov
2020-05-05 11:48 ` Niklas Holsti
2020-05-05 13:44   ` hreba
2020-05-05 15:45 ` Jeffrey R. Carter
2020-05-05 17:17   ` hreba
2020-05-05 19:08     ` Niklas Holsti
2020-05-06 19:31       ` hreba
2020-05-09 19:43         ` Niklas Holsti
2020-05-10 15:10           ` hreba
2020-05-05 19:19     ` Jere
2020-05-06  6:42     ` Mark Lorenzen
2020-05-06  8:26       ` Simon Wright
2020-05-06  8:33         ` Mark Lorenzen
2020-05-05 17:32 ` hreba
2020-05-05 19:04   ` Niklas Holsti
2020-05-05 20:11     ` Niklas Holsti
2020-05-06 13:13       ` hreba
2020-05-06 17:30   ` Niklas Holsti
2020-05-06 18:28     ` Jere
2020-05-06 19:09       ` Niklas Holsti
2020-05-07  9:07     ` J-P. Rosen
2020-05-07 10:15       ` Niklas Holsti
2020-05-07 13:00         ` Egil H H [this message]
2020-05-07 13:25         ` Simon Wright
2020-05-07 10:31       ` Stefan.Lucks
2020-05-07 11:58         ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox