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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a9844368dd0a842 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: seperate keyword and seperate compilation with Gnat? Date: 1996/07/08 Message-ID: #1/1 X-Deja-AN: 167195519 references: <31D95D93.28D8D15B@jinx.sckans.edu> <31DA7327.6CE2@epi.syr.lmco.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-08T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >We have looked into this issue recently, and here is one interesting >observation. There are two quite different types of subunits: > > 1. Those which are ultimately nested within a procedure > > 2. Those which are ultimately nested within a library level package > >For example, if you have a package spec with a bunch of subprograms, and >then a package body, where the bodies of the subprograms are stubs, this >would be type 2 subunits. It seems to me that the hardest kind of subunit to compile is when the parent is a subprogram, and the subunit is a package. The "am I a task master?" issue that was mentioned only applies in this case, for example. >Anyway, it would really be interesting to here if there are interesting >examples of large type 2 cases which would make it worth fixing at least >this subunit case to do "true" separate compilation. I suspect that most subunits are subprograms, and their parents are most often packages. That's true of most code I've seen, and code I've written myself. On the other hand, I'm pretty happy with GNAT subunit handling as it is, since I'm pretty happy to use child units instead. What can subunits do that child units can't? Well, a subunit can see stuff in the parent's body. But that's not a big deal -- just move that stuff to a private child package, and then you can turn your subunit into a child. (I'm not claiming that this is feasible for existing code -- just that if you're writing new code, and you think about it ahead of time, it's generally pretty easy to use child units instead of subunits.) - Bob