comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: AQ&S Guidance on pragma Elaborate_Body
Date: 1997/04/28
Date: 1997-04-28T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.97Apr28154951@spectre.mitre.org> (raw)
In-Reply-To: dewar.862079640@merv


In article <dewar.862079640@merv> dewar@merv.cs.nyu.edu (Robert Dewar) writes:

  > Well of coruse this is true, and is why a purely static solution
  > cannot be 100% accurate. But It is *very* rare, I would say
  > non-existent almost, for anything other than specially constructed
  > tests to run into this, and the limitation in expressive power
  > from forbidding such cycles is negligible.

  I thought that Robert Dewar did provide an example from GNAT where
the pragmas were needed?  In any case, the reality is not that there
are very few programs which can be written so that the pragmas are not
needed, but that the pragmas and the error messages help Ada
programmers find a livable elaboration order, and to live with the
situations where proper execution requires a certain elaboration order.

  I spent most of Friday afternoon doing just that.  Now the real
problem in my case was a place where the Ada rules are slightly too
restrictive.  (And no, I am not suggesting that they be fixed...)  The
problem was that I have a tagged type call it Foo, and an access type
say Bar:

      type Foo is new Foob with private;
      type Bar is access all Foo'Class;

  So far so good, but now I want to instantiate a generic with:

     generic
       type Foobar is abstract new Foob with private;
       type Barf is access all Foobar;
     package Barfoo is ...

    Even though Foobar is not used within package Barfoo, I can't
instantiate the generic for Foo and Bar until after the completion of
the declaration Foo.  (And note that abstract, it is not just that I
don't declare an object of type Foobar, I can't.  But there could be a
(non-abstract) type derived from Foobar so it would take new syntax
for something of very marginal utility.  "type Foobar is abstract
final new Foo with private;" for example.

    As I said, not worth fixing.  But to get my program to compile
cleanly, I had to introduce a new unit with a "programmer knowledge
only" elaboration dependency.  Of course I documented the reason as a
comment on the pragma Elaborate_All.

    And, yes, I have worked with programs where the "right"
elaboration order could only be determined from files read at
execution time.  Of course the programming team knew the right order
and embedded it in Elaborates and project documentation.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  reply	other threads:[~1997-04-28  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 A Duff
1997-04-21  0:00   ` Michael F Brenner
1997-04-22  0:00     ` Robert A Duff
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 [this message]
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         ` Matthew Heaney
1997-04-24  0:00           ` Jon S Anthony
1997-04-24  0:00             ` Matthew Heaney
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-26  0:00               ` Nick Roberts
1997-04-26  0:00                 ` Robert A Duff
1997-04-26  0:00                 ` Matthew Heaney
1997-04-25  0:00             ` Robert Dewar
1997-04-24  0:00           ` Robert A Duff
1997-04-24  0:00           ` Robert Dewar
1997-04-25  0:00           ` Michael F Brenner
1997-04-26  0:00             ` Nick Roberts
1997-04-24  0:00         ` Laurent Guerby
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           ` Robert A Duff
1997-04-21  0:00           ` Matthew Heaney
1997-04-22  0:00             ` Mats Weber
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 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-23  0:00                     ` Robert Dewar
1997-04-24  0:00                 ` Robert Dewar
1997-04-24  0:00                   ` Robert A Duff
1997-04-23  0:00             ` Robert Dewar
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