From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Need a Wild Library Unit Elaboration Example
Date: 15 Oct 2005 21:01:55 -0400
Date: 2005-10-15T21:01:55-04:00 [thread overview]
Message-ID: <wcc4q7igtq4.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1h4eaav.1bgg5vt1bfffh6N%csampson@inetworld.net
csampson@inetworld.net (Charles H. Sampson) writes:
> I'm preparing a talk on elaboration with the ultimate
> goal being an understanding of the problems you can get
> into with library unit elaboration when you make calls
> between packages. Most of the emphasis is on the common
> stuff: The package's elaboration code or an object's
> initialization using a subprogram from another package.
You should read the GNAT documentation. There's a very clear
description of elaboration issues in there somewhere --
with discussion of when various pragmas are needed and
whatnot.
> I like to end the talk with three examples that I
> characterize as pathological; cross-package dependencies
> you likely wouldn't think of on your first encounter with
> the subject. Unfortunately for me, one of my examples has
> been obsoleted by pragma Elaborate_Body. I think three
> examples is just the right number, so I'm asking for your
> favorite examples of cross-package dependencies to fill
> out my list again.
How about a dispatching call to a procedure that doesn't
exist yet? Or something similar with access-to-procedures?
> Just to avoid duplication, my two remaining examples
> are elaboration code that calls a protected object entry
> whose barrier condition uses a function from another
> package and elaboration code that calls a task entry that
> has a call to a subprogram from another package in its
> rendezvous. (I'm not promoting this as good coding
> practice, mind you. I'm just trying to illustrate how
> hairy things can get, theoretically.)
I don't see why these are pathological. Unusual, perhaps.
But still a perfectly reasonable combination of features
that ought to be orthogonal. Define "pathological".
>...Also, as part of
> the non-pathological stuff, I've covered the elaboration
> of a statically allocated task's declarative part as part
> of the elaboration of a containing package.
I think most of my troubles with elaboration have involved generics --
perhaps elaboration of an instance of the generic doesn't do much of
anything, but Elaborate_All doesn't work, because something calls
something else. And the instance is usually elaborated at library
level.
A key point is that there's no issue unless there's some sort of mutual
recursion going on.
- Bob
prev parent reply other threads:[~2005-10-16 1:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-14 6:54 Need a Wild Library Unit Elaboration Example Charles H. Sampson
2005-10-16 1:01 ` Robert A Duff [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox