comp.lang.ada
 help / color / mirror / Atom feed
From: cmcknigh@hercii.lasc.lockheed.com (Chris McKnight)
Subject: Re: Elaboration order
Date: 1996/03/19
Date: 1996-03-19T00:00:00+00:00	[thread overview]
Message-ID: <1996Mar19.023129.27619@enterprise.rdd.lmsc.lockheed.com> (raw)
In-Reply-To: 314D2E1C.5C72@lfwc.lockheed.com

In article 5C72@lfwc.lockheed.com, Ken Garlington <garlingtonke@lfwc.lockheed.com> () writes:
>Mark A Biggar wrote:
>> 
>> In article <31494143.3825@lfwc.lockheed.com> Ken Garlington <garlingtonke@lfwc.lockheed.com> writes:
>> >Robert A Duff wrote:
>> >[the standard answer, except it didn't explain...]
>> >Why doesn't the subprogram body have to be elaborated before the call?
>> 
>> It does.
>
>Please cite the Ada 83 reference for this. I can't find it.
>
  Guess you didn't read my response.  The reference Ada 83 LRM reference
  is 7.3 paragraph 4, the key line being:

    "          ...a call of such a subprogram by an outside program 
     unit raise the exception PROGRAM_ERROR if the call takes place
     before the elaboration of the package body"

>In fact, in general, for all respondents to this question, if you
>say that pragma Elaborate is _not_ needed in a particular context,
>please cite an 83 reference.

  A reference to when something is NOT needed?  Would you expect
  such a thing?  Think about it; do you really expect a specific
  reference to when.. say NUMERIC_ERROR is NOT raised?

  Look at it this way, since all discussion in the LRM for pragma
  Elaborate lists the kind of cases you may need it for, the easiest
  way to determine that it is not needed is to determine that your
  code can not fall into one of these cases.  And since all of these
  cases involve actions which occur during elaboration, the easiest
  way to avoid it is not to make these type of assignments during
  elaboration.  This is especially true if you are directing others.
  It's far easier to say "No assignments of this type during elaboration"
  than to list when one may or may not need to use pragma Elaborate.

>                             I can't even find a reference that
>says the body can be assured of the elaboration of its own spec!

  The requirement for a spec to be elaborated before the body is in
  3.9 Declarative Parts.  Paragraph 3 states that the elaboration of
  a declarative part consists of the elaboration of the declarative items 
  "in the order in which they are given in the declarative part".

  And I think it's clear that the order given in the declarative part
  is required to be spec before body.  See 3.9 paragraph 9 for that 
  specific requirement for your example.

  But again, I ask, "Why worry about elaboration order problems when they
  are easily avoided?"

  Cheers,

     Chris





  parent reply	other threads:[~1996-03-19  0:00 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <314701A1.469D@lfwc.lockheed.com>
1996-03-15  0:00 ` Elaboration order Robert I. Eachus
1996-03-15  0:00   ` Robert Dewar
     [not found] ` <1996Mar14.021345.9856@enterprise.rdd.lmsc.lockheed.com>
     [not found]   ` <314829CD.4FA9@lfwc.lockheed.com>
1996-03-15  0:00     ` Tucker Taft
1996-03-15  0:00       ` Ken Garlington
1996-03-16  0:00     ` Ted Dennison
1996-03-16  0:00     ` Joe Wierzbowski
1996-03-26  0:00       ` AdaWorks
1996-03-26  0:00         ` Robert A Duff
1996-03-26  0:00         ` Robert Dewar
1996-03-26  0:00           ` Robert A Duff
1996-03-26  0:00             ` Robert Dewar
1996-03-26  0:00           ` IO in Pure packages, debugging Laurent Guerby
1996-03-26  0:00     ` Elaboration order Laurent Guerby
1996-03-26  0:00       ` Robert A Duff
1996-03-18  0:00 ` Ken Garlington
1996-03-18  0:00 ` Ted Dennison
1996-03-19  0:00 ` Michel Gauthier
1996-03-20  0:00 ` DenReimer
1996-03-20  0:00   ` Tucker Taft
1996-03-20  0:00   ` Robert A Duff
1996-03-20  0:00     ` Norman H. Cohen
1996-03-20  0:00       ` Robert Dewar
1996-03-20  0:00   ` Norman H. Cohen
     [not found] ` <Do8JDv.A2v@world.std.com>
     [not found]   ` <31494143.3825@lfwc.lockheed.com>
1996-03-15  0:00     ` Robert A Duff
1996-03-18  0:00       ` Norman H. Cohen
     [not found]       ` <EACHUS.96Mar18143219@spectre.mitre.org>
1996-03-18  0:00         ` Robert Dewar
1996-03-19  0:00           ` Ted Dennison
1996-03-18  0:00         ` Robert Dewar
1996-03-20  0:00         ` David Emery
1996-03-15  0:00     ` Mark A Biggar
1996-03-18  0:00       ` Ken Garlington
1996-03-19  0:00         ` Norman H. Cohen
1996-03-20  0:00           ` Cordes MJ
1996-03-19  0:00             ` Robert Dewar
1996-03-21  0:00               ` Ken Garlington
1996-03-21  0:00               ` Cordes MJ
1996-03-20  0:00             ` Robert A Duff
1996-03-20  0:00               ` Cordes MJ
1996-03-20  0:00                 ` Robert A Duff
1996-03-22  0:00                   ` Cordes MJ
1996-03-20  0:00                 ` Robert Dewar
1996-03-21  0:00                   ` Ken Garlington
1996-03-23  0:00                 ` JP Thornley
1996-03-25  0:00                   ` Robert Dewar
1996-03-26  0:00                 ` JP Thornley
1996-03-19  0:00         ` Chris McKnight [this message]
1996-03-21  0:00           ` Ken Garlington
1996-03-20  0:00   ` Robert I. Eachus
1996-03-22  0:00   ` Robert I. Eachus
1996-03-22  0:00   ` Robert I. Eachus
     [not found] <DoDMLL.1F9@world.std.com>
1996-03-18  0:00 ` Chris McKnight
1996-03-18  0:00 Jean-Pierre Rosen
1996-03-21  0:00 ` Ken Garlington
  -- strict thread matches above, loose matches on Subject: below --
1999-11-15  0:00 Elaboration Order Wolf-Dieter Heker
1999-11-15  0:00 ` Robert Dewar
1999-11-16  0:00   ` Wolf-Dieter Heker
1999-11-16  0:00     ` David C. Hoos, Sr.
1999-11-16  0:00     ` Robert Dewar
1999-11-16  0:00     ` Robert Dewar
1999-11-20  0:00       ` Simon Wright
1999-11-22  0:00         ` Robert Dewar
1999-11-23  0:00           ` Mats Weber
1999-11-15  0:00 ` Jean-Pierre Rosen
1999-11-15  0:00   ` Robert Dewar
1999-11-16  0:00     ` Jean-Pierre Rosen
1999-11-20  0:00       ` Simon Wright
replies disabled

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