From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,95d3d2cf6edcb1b8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Need a Wild Library Unit Elaboration Example Date: 15 Oct 2005 21:01:55 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1h4eaav.1bgg5vt1bfffh6N%csampson@inetworld.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1129424515 21399 192.74.137.71 (16 Oct 2005 01:01:55 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 16 Oct 2005 01:01:55 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5715 Date: 2005-10-15T21:01:55-04:00 List-Id: 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