* Need a Wild Library Unit Elaboration Example
@ 2005-10-14 6:54 Charles H. Sampson
2005-10-16 1:01 ` Robert A Duff
0 siblings, 1 reply; 2+ messages in thread
From: Charles H. Sampson @ 2005-10-14 6:54 UTC (permalink / raw)
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.
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.
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.) 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.
Charlie
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Need a Wild Library Unit Elaboration Example
2005-10-14 6:54 Need a Wild Library Unit Elaboration Example Charles H. Sampson
@ 2005-10-16 1:01 ` Robert A Duff
0 siblings, 0 replies; 2+ messages in thread
From: Robert A Duff @ 2005-10-16 1:01 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-16 1:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-14 6:54 Need a Wild Library Unit Elaboration Example Charles H. Sampson
2005-10-16 1:01 ` Robert A Duff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox