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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71f9c948bec0bcad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-14 11:46:45 PST Path: bga.com!news.sprintlink.net!sundog.tiac.net!wizard.pn.com!Germany.EU.net!EU.net!howland.reston.ans.net!cs.utexas.edu!convex!news.duke.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: "Common" data Date: 13 Oct 94 11:47:22 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <9410121737.AA28756@eurocontrol.de> NNTP-Posting-Host: spectre.mitre.org In-reply-to: stt@dsd.camb.inmet.com's message of Thu, 13 Oct 1994 03:21:06 GMT Date: 1994-10-13T11:47:22+00:00 List-Id: In article stt@dsd.camb.inmet.com (Tucker Taft) writes: > I believe Robert Eachus misinterpreted this question. I think the > question is very simple and very fundamental -- if two > different compilation units "with" the same package, do you > end up with just one copy of the data of the package, or > might you get one for each "with"? I won't argue about what the original question "meant." If the questioner is satisfied, fine. Otherwise, we can try to refine the question. I assumed from the mention of comm code, that the question had to do with keeping copies of variables in registers. > The answer is most definitely that you get exactly one > copy of the data of the package, no matter how many > times it is "with"ed. This is so fundamental to Ada > that it may be hard to point to one single place in the manual > that says it straight out. The introduction to chapter 10 comes > closest to saying that a program has at most one copy of any given > compilation unit. Also, when "with" clauses are explained, > they simply talk about making the "with"ed unit "visible." If this is the issue, then the answer can be deduced by looking at the elaboration rules. For instance, for a variable declared in a package specification withed by several units, look at 10.5(1), 7.2(3), and finally 3.2.1(7): "The object is created." -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...