comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Re: Function Calls by Address
Date: 1999/09/22
Date: 1999-09-22T17:18:14+00:00	[thread overview]
Message-ID: <37E9106F.72E3B948@mitre.org> (raw)
In-Reply-To: wcc7lljb0yn.fsf@world.std.com

Robert A Duff wrote:
 
> I don't understand the elaboration order issue.  The rules are that the
> elaboration or is *exactly* as if you move all the with_clauses from the
> subunits up to the containing library unit.  So that part is easy.

     I finally see what you are talking about.  Subunits allow you to
create a program which will raise Program_Error or some other exception
at run-time.  Of course you can use pragma Suppress(Elaboration_Check)
to prevent this where you KNOW that the elaboration rules are too
conservative, but I don't recommend this.  Or you could complete all
your work before the main program is called...  However, in Ada there
are usually many legal compilation orders for such programs--if subunits
are used to minimize the number of with_clauses on any unit.

    Now assume you need to do maintenance on a program that is near the
edge, or more likely you are reusing such software.  If elaboration
checks were done at compile time, you would have a great deal of
difficulty making the changes.  (In other languages you could make the
changes, but with no assurance that the result would run correctly.) 
Almost any change would require recompiling everything.  The net result
would be that programs which do a lot of work during elaboration were
difficult to build and maintain.

    Using subunits can simplify this process greatly, and were often
used that way in Ada 83.  However, as Bob Duff points out, with child
units now available in Ada 95 there is no need to use subunits this
way.  Subunits still can be used to minimize the amount of code to be
recompiled, but compilers are getting faster, and private child units
can often accomplish the same effect.
 
-- 

                                        Robert I. Eachus

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




  reply	other threads:[~1999-09-22  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  0:00 Function Calls by Address Craig Jameson
1999-08-30  0:00 ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00   ` Martin Gangkofer
1999-08-30  0:00 ` Marin David Condic
1999-08-30  0:00   ` Marin David Condic
1999-08-30  0:00     ` Larry Kilgallen
1999-08-30  0:00   ` Robert Dewar
1999-08-31  0:00 ` David Kristola
1999-08-31  0:00 ` Matthew Heaney
1999-09-01  0:00 ` Simon Wright
1999-09-02  0:00 ` Francois Godme
1999-09-03  0:00   ` Robert Dewar
1999-09-03  0:00     ` Francois Godme
1999-09-03  0:00       ` David C. Hoos, Sr.
1999-09-04  0:00         ` Robert Dewar
1999-09-05  0:00           ` Francois Godme
1999-09-06  0:00             ` Robert Dewar
1999-09-06  0:00               ` Francois Godme
1999-09-06  0:00                 ` Robert Dewar
1999-09-06  0:00                 ` Robert Dewar
1999-09-06  0:00                   ` Bob Collins
1999-09-07  0:00                     ` Pascal Obry
1999-09-07  0:00                 ` Pascal Obry
1999-09-07  0:00                   ` Francois Godme
1999-09-08  0:00                   ` Francois Godme
1999-09-03  0:00       ` Marin David Condic
1999-09-14  0:00         ` Robert I. Eachus
     [not found]           ` <wcc3dwgb7ii.fsf@world.std.com>
     [not found]             ` <37E81079.CC2566D9@mitre.org>
1999-09-22  0:00               ` Robert A Duff
1999-09-22  0:00                 ` Robert I. Eachus [this message]
1999-09-23  0:00                 ` Robert Dewar
1999-09-23  0:00                   ` Robert A Duff
1999-09-03  0:00       ` Robert Dewar
1999-09-03  0:00         ` Ted Dennison
1999-09-04  0:00           ` Jean-Pierre Rosen
1999-09-05  0:00             ` Matthew Heaney
1999-09-05  0:00             ` Ehud Lamm
1999-09-04  0:00         ` Brian Rogoff
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-03  0:00       ` Simon Wright
1999-09-04  0:00       ` Mario Klebsch
1999-09-05  0:00         ` Robert Dewar
1999-09-06  0:00           ` Francois Godme
1999-09-05  0:00             ` Brian Rogoff
1999-09-06  0:00             ` Robert Dewar
1999-09-08  0:00               ` Georg Bauhaus
1999-09-05  0:00       ` Geoff Bull
1999-09-07  0:00       ` Michael F. Yoder
replies disabled

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