comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Visibility and Elaboration
Date: Wed, 11 Jun 2003 06:50:16 GMT
Date: 2003-06-11T06:50:16+00:00	[thread overview]
Message-ID: <3EE6D120.2020701@attbi.com> (raw)
In-Reply-To: Dm4Fa.80103$d51.148194@sccrnsc01

tmoran@acm.org wrote:
>>Tasks created by allocators are a more common case of
>>elaboration after the main program starts execution.
> 
>    "we elaborate declarations and execute statements", Barnes,
> "Programming in Ada 95".  Are you using the term in a different
> (more restricted) way?

Not at all.  Most things that require elaboration occur in library 
packages, so that the elaboration occurs before the main program 
executes.  (And some are in the declarative part of the main procedure, 
you can argue whether they come before or after the main program starts 
executing.)

But some declarations occur in declare blocks, or in the declarative 
part of a task or in one of several other areas where elaboration csn 
occur well after the main program starts executing.

The usual place I see people getting confused by this is in generics. 
Some things are elaborated when the generic declaration is elaborated, 
other elaborations occur when the generic body is elaborated.  Finally 
the generic instance itself is elaborated.  Technically all three of 
these can occur after the main program is elaborated.  The most common 
case is that the generic declaration and generic body are elaborated 
before the main program.  Often instances of generics are elaborated 
after the main program is running.

When I taught Ada, one of the classroom exercises was to study an 
example where some parameters for the generic instantiation were read in 
by the main program, in particular the range of an array subtype.






  reply	other threads:[~2003-06-11  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7BD8CDF4.671052CE.0015D3EC@netscape.net>
2003-06-09 11:35 ` Visibility and Elaboration David C. Hoos, Sr.
2003-06-09 18:14   ` Robert I. Eachus
2003-06-09 18:29     ` tmoran
2003-06-11  6:50       ` Robert I. Eachus [this message]
2003-06-11  7:49         ` tmoran
2003-06-11 21:11           ` Robert I. Eachus
2003-06-11 10:40 And838N
  -- strict thread matches above, loose matches on Subject: below --
2003-06-10  8:33 And838N
2003-06-09 10:47 And838N
replies disabled

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