comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: AQ&S Guidance on pragma Elaborate_Body
Date: 1997/04/24
Date: 1997-04-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.861864497@merv> (raw)
In-Reply-To: mheaney-ya023680002204970735480001@news.ni.net


Responding To Bob Duff's example

   generic
   package G1 is ... end G1;

   package body G1 is ... end G1;

   generic
   package G2 is ... end G2;

   with G1;
   package body G2 is
       package Inst_1 is new G1;
   end G2;

   with G2; pragma Elaborate(G2);
   package P is
       package Inst_2 is new G2;
   end P;

Matthew Heaney asks

  But isn't G2 supposed to elaborate G1?

  with G1;
  pragma Elaborate (G1);   <<<---
  package body G2 is
      package Inst_1 is new G1;
  end G2;

  Isn't G2 supposed to take care of it's own business, and make sure G1 is
  elaborated?  This is analogous to P making sure G2 is elaborated.

Robert Dewar replies

In general the answer is no. G2 has no elaboration problem (generic packages
themselves require nothing to be elaborated). It is the instance of G2
that might need elaboration.

If no one ever instantiates G2 in elaboration code, then there is absolutely
no need to elaborate the body of G1 before the spec of G2. This requirement
comes from the fact that P instantiates G2 at elaboration time. Thus P
must take responsibility for the elaboration, and do a pragma Elaborate_All,
rather than a pragma Elaborate.

Note: This is exactly the kind of automatic Elaborate_All that the new
version of GNAT does by default. It will also on request output warnings
for missing Elaborate_All pragmas.







  parent reply	other threads:[~1997-04-24  0:00 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  0:00 AQ&S Guidance on pragma Elaborate_Body JP Thornley
1997-04-18  0:00 ` Robert Dewar
1997-04-19  0:00   ` Michael Paus
1997-04-19  0:00     ` Robert A Duff
1997-04-21  0:00       ` Robert Dewar
1997-04-23  0:00         ` Robert A Duff
1997-04-23  0:00           ` Robert Dewar
1997-04-24  0:00             ` Robert A Duff
1997-04-24  0:00               ` Robert Dewar
1997-04-24  0:00                 ` Robert Dewar
1997-04-25  0:00                   ` Robert A Duff
1997-04-25  0:00                 ` Mats Weber
1997-04-25  0:00                   ` Robert I. Eachus
1997-04-26  0:00                     ` Nick Roberts
1997-04-26  0:00                       ` Robert Dewar
1997-04-28  0:00                         ` Robert I. Eachus
1997-04-29  0:00                           ` Robert Dewar
1997-04-29  0:00                             ` Robert I. Eachus
1997-04-27  0:00                   ` Robert Dewar
1997-04-28  0:00                     ` Mats Weber
1997-04-29  0:00                     ` Redefinition of "=", elaboration and learning Ada Mats Weber
1997-04-29  0:00                       ` Robert A Duff
1997-04-30  0:00                         ` Mats Weber
1997-04-26  0:00                 ` AQ&S Guidance on pragma Elaborate_Body Nick Roberts
1997-04-26  0:00                   ` Robert Dewar
1997-04-24  0:00           ` Mats Weber
1997-04-24  0:00             ` Robert A Duff
1997-04-24  0:00               ` Robert Dewar
1997-04-25  0:00             ` Robert Dewar
1997-04-20  0:00     ` Robert Dewar
1997-04-21  0:00     ` Michael F Brenner
1997-04-23  0:00       ` Robert Dewar
1997-04-24  0:00         ` Laurent Guerby
1997-04-24  0:00         ` Matthew Heaney
1997-04-24  0:00           ` Robert Dewar
1997-04-24  0:00           ` Robert A Duff
1997-04-24  0:00           ` Jon S Anthony
1997-04-24  0:00             ` Matthew Heaney
1997-04-26  0:00               ` Nick Roberts
1997-04-26  0:00                 ` Matthew Heaney
1997-04-26  0:00                 ` Robert A Duff
1997-04-26  0:00               ` Robert Dewar
1997-04-26  0:00                 ` Matthew Heaney
1997-04-27  0:00                   ` Robert Dewar
1997-04-29  0:00                     ` John G. Volan
1997-04-29  0:00                       ` Matthew Heaney
1997-04-30  0:00                         ` Jon S Anthony
1997-05-01  0:00                         ` John G. Volan
1997-05-02  0:00                           ` Booch "forms" and child packages [was: AQ&S Guidance on pragma Elaborate_Body] John G. Volan
1997-05-02  0:00                         ` AQ&S Guidance on pragma Elaborate_Body John G. Volan
1997-04-25  0:00             ` Robert Dewar
1997-04-25  0:00           ` Michael F Brenner
1997-04-26  0:00             ` Nick Roberts
1997-04-18  0:00 ` Robert A Duff
1997-04-21  0:00   ` Michael F Brenner
1997-04-22  0:00     ` Robert A Duff
1997-04-20  0:00 ` Doug Smith
1997-04-20  0:00   ` Robert Dewar
1997-04-21  0:00     ` Matthew Heaney
1997-04-21  0:00       ` Robert A Duff
1997-04-21  0:00         ` Matthew Heaney
1997-04-21  0:00           ` Matthew Heaney
1997-04-22  0:00             ` Robert A Duff
1997-04-22  0:00               ` Matthew Heaney
1997-04-22  0:00                 ` Robert A Duff
1997-04-22  0:00                   ` Matthew Heaney
1997-04-23  0:00                     ` Robert Dewar
1997-04-23  0:00                     ` Robert A Duff
1997-04-24  0:00                       ` Matthew Heaney
1997-04-24  0:00                         ` Robert A Duff
1997-04-25  0:00                       ` Robert Dewar
1997-04-24  0:00                 ` Robert Dewar [this message]
1997-04-24  0:00                   ` Robert A Duff
1997-04-22  0:00             ` Mats Weber
1997-04-23  0:00             ` Robert Dewar
1997-04-21  0:00           ` Robert A Duff
1997-04-21  0:00         ` Robert Dewar
1997-04-22  0:00           ` Robert A Duff
1997-04-24  0:00             ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-04-30  0:00 W. Wesley Groleau (Wes)
1997-04-30  0:00 ` Robert I. Eachus
replies disabled

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