comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <matsw@mail.com>
Subject: Re: generic package dilemma
Date: 1999/11/20
Date: 1999-11-20T00:00:00+00:00	[thread overview]
Message-ID: <3836D487.B741CBF1@mail.com> (raw)
In-Reply-To: 3835cb73_3@news1.prserv.net

Matthew Heaney wrote:
> 
> In article <81449o$1fh$1@nnrp1.deja.com> , Robert Dewar
> <robert_dewar@my-deja.com>  wrote:
> 
> > The rule is simple, if you instantiate a generic from within
> > elaboration code, then you must use a pragma Elaborate_All
> > on the generic.
> 
> But Mats seems to be saying that if you do this:
> 
> generic
>    ...
> package GQ is ... end GQ;
> 
> with GP;
> package body GQ is
>   package P is new GP;
> ...
> end GQ;
> 
> then you should NOT use an elaborate(_all) pragma on GP.  This would
> appear to be in violation of the rule that you're advocating.

No. The above is in a generic body, whose elaboration does nothing: the
actual instantiation of GP is going to happen only when GQ is
instantiated. If GQ were not generic, then you would need the pragma.

GP's body will need to be elaborated before any non-generic unit that
instantiates GQ, and that's the only constraint. In particular, it can
be elaborated after GQ's body, and that's because GQ is a generic.

The elaboration of a generic body has no other effect than to establish
that from now on, the generic can be elaborated. Check the RM for details.

> So which is it: should the body of GQ above pragma Elaborate_All (GP),
> or not?

no pragma is necessary.






  reply	other threads:[~1999-11-20  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-17  0:00 generic package dilemma Riyaz Mansoor
1999-11-17  0:00 ` Matthew Heaney
1999-11-17  0:00   ` Mats Weber
1999-11-17  0:00     ` Matthew Heaney
1999-11-18  0:00       ` Robert A Duff
1999-11-18  0:00         ` Matthew Heaney
1999-11-18  0:00       ` Mats Weber
1999-11-18  0:00         ` Matthew Heaney
1999-11-19  0:00           ` Mats Weber
1999-11-19  0:00             ` Vladimir Olensky
1999-11-19  0:00             ` Matthew Heaney
1999-11-19  0:00               ` Robert Dewar
1999-11-19  0:00                 ` Robert I. Eachus
1999-11-22  0:00                   ` Robert Dewar
1999-11-22  0:00                     ` Matthew Heaney
1999-11-19  0:00                 ` Matthew Heaney
1999-11-20  0:00                   ` Mats Weber [this message]
1999-11-19  0:00               ` Mats Weber
1999-11-22  0:00                 ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Robert A Duff
1999-11-23  0:00                       ` Robert Dewar
1999-12-01  0:00                       ` Robert I. Eachus
1999-12-01  0:00                         ` Robert I. Eachus
1999-11-22  0:00                   ` Larry Kilgallen
1999-11-23  0:00                     ` Robert Dewar
1999-11-22  0:00                   ` Robert A Duff
1999-11-23  0:00                     ` Robert Dewar
1999-11-29  0:00                       ` Robert A Duff
1999-12-01  0:00                         ` Robert Dewar
1999-12-01  0:00                       ` Robert A Duff
1999-12-02  0:00                         ` Mats Weber
1999-12-03  0:00                           ` Robert Dewar
1999-12-03  0:00                             ` Robert A Duff
1999-12-06  0:00                               ` Robert Dewar
1999-12-03  0:00                             ` Ted Dennison
1999-12-04  0:00                               ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Bryce Bardin
1999-11-23  0:00                     ` Robert Dewar
1999-11-19  0:00       ` Robert Dewar
1999-11-18  0:00   ` Riyaz Mansoor
1999-11-19  0:00     ` Robert Dewar
1999-11-19  0:00   ` Robert Dewar
replies disabled

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