comp.lang.ada
 help / color / mirror / Atom feed
* Elaboration Order
@ 1999-11-15  0:00 Wolf-Dieter Heker
  1999-11-15  0:00 ` Jean-Pierre Rosen
  1999-11-15  0:00 ` Robert Dewar
  0 siblings, 2 replies; 65+ messages in thread
From: Wolf-Dieter Heker @ 1999-11-15  0:00 UTC (permalink / raw)


I think that Ada95 leaves too much freedom with respect to the elaborations
order of library units unless the user specifies lots of pragmas. This was
already the case in Ada83, although the introduction of elaborate_body
slightly improved the situation.
From my point of view, most of the library packages ever written are 'simple
ones', i.e. they need no special treatment with respect to elaboration
order.  Hence I would suggest that these packages should contain an
elaborate_body pragma (except, of course, if the have no body). But alas,
most programmers - including myself ;-) - do not write these pragmas until
the get into trouble.
The lack of these pragmas is a portability issue. And isn't it true that if
a package body cannnot be elaborated immediately after the spec we have
generally a doubtful design? (This is not to say there might be no reasons
for such a structure, just that it would be more the exception rathern than
the rule.)

Now my major question: Why didn't the language designers choose an approach
that would make the standard case easy and provide a pragma
defer_elaboration_of_body for those rare cases, where the user doesn't want
the body elaborated immediately after the spec? Is there more reason that
just compatibility with the user unfriendly definition of Ada83?

Wolf-Dieter Heker






^ permalink raw reply	[flat|nested] 65+ messages in thread
[parent not found: <314701A1.469D@lfwc.lockheed.com>]
[parent not found: <DoDMLL.1F9@world.std.com>]
* Re: Elaboration order
@ 1996-03-18  0:00 Jean-Pierre Rosen
  1996-03-21  0:00 ` Ken Garlington
  0 siblings, 1 reply; 65+ messages in thread
From: Jean-Pierre Rosen @ 1996-03-18  0:00 UTC (permalink / raw)


I'm surprised nobody mentionned this (or did I miss it?). If you know the
body of the package does not have any cross-calls at elaboration (which is
the common case), put a pragma Elaborate_Body in the spec.
The body will then be elaborated immediately after the sepc, so no user of
the package will run into problems with elaboration order.
BTW: this is Ada 95 of course, but  putting the pragma in an Ada 83 program
will not harm...
+------------------------------------o-------------------------------------+
| P-mail:                            | E-mail: rosen@enst.fr               |
|   ADALOG - 27 avenue de Verdun     |    Tel: +33 1 46 45 51 12           |
|   92170 Vanves - FRANCE            |    Fax: +33 1 46 45 52 49           |
+------------------------------------o-------------------------------------+




^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~1999-11-23  0:00 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-15  0:00 Elaboration Order Wolf-Dieter Heker
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
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-20  0:00       ` Simon Wright
1999-11-22  0:00         ` Robert Dewar
1999-11-23  0:00           ` Mats Weber
1999-11-16  0:00     ` Robert Dewar
     [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     ` 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   ` Norman H. Cohen
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   ` Tucker Taft
     [not found] ` <Do8JDv.A2v@world.std.com>
     [not found]   ` <31494143.3825@lfwc.lockheed.com>
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               ` Cordes MJ
1996-03-21  0:00               ` Ken Garlington
1996-03-20  0:00             ` Robert A Duff
1996-03-20  0:00               ` Cordes MJ
1996-03-20  0:00                 ` Robert Dewar
1996-03-21  0:00                   ` Ken Garlington
1996-03-20  0:00                 ` Robert A Duff
1996-03-22  0:00                   ` Cordes MJ
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
1996-03-21  0:00           ` Ken Garlington
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-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
  -- strict thread matches above, loose matches on Subject: below --
1996-03-18  0:00 Jean-Pierre Rosen
1996-03-21  0:00 ` Ken Garlington

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