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-12 23:03:17 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!EU.net!uunet!noc.near.net!inmet!dsd!stt From: stt@dsd.camb.inmet.com (Tucker Taft) Subject: Re: "Common" data Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <9410121737.AA28756@eurocontrol.de> Date: Thu, 13 Oct 1994 03:21:06 GMT Date: 1994-10-13T03:21:06+00:00 List-Id: In article , Robert I. Eachus wrote: >In article <9410121737.AA28756@eurocontrol.de> > Bob Wells #402 writes: > > > Where abouts in the LRM does it say that I will only have one copy > > of the variable T in the following code? This is naturally what you > > would expect, that A.New_T_Value and B.New_T_Value would be working > > on the same T, but is this defined in the LRM? > > > This is a trivialization of some comms code delivered to us, and we > > wanted to see if the behaviour was defined by the LRM. > > You could start with RM 9.11 Shared Variables. ... 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"? 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." A "with" is *not* like an include, it is just a way to identify the other units that can be referenced. It has no effect other than to make the specified unit visible, and to ensure that when A is included in a program, and A with's B, then B will also be included in the program. > ... > Robert I. Eachus -Tucker Taft stt@inmet.com