comp.lang.ada
 help / color / mirror / Atom feed
From: stt@dsd.camb.inmet.com (Tucker Taft)
Subject: Re: "Common" data
Date: Thu, 13 Oct 1994 03:21:06 GMT
Date: 1994-10-13T03:21:06+00:00	[thread overview]
Message-ID: <CxLDB7.9DI@inmet.camb.inmet.com> (raw)
In-Reply-To: EACHUS.94Oct12143818@spectre.mitre.org

In article <EACHUS.94Oct12143818@spectre.mitre.org>,
Robert I. Eachus <eachus@spectre.mitre.org> wrote:

>In article <9410121737.AA28756@eurocontrol.de> 
> Bob Wells #402 <wel@EUROCONTROL.DE> 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



  reply	other threads:[~1994-10-13  3:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-12 17:37 "Common" data Bob Wells #402
1994-10-12 14:38 ` Robert I. Eachus
1994-10-13  3:21   ` Tucker Taft [this message]
1994-10-13 11:47     ` Robert I. Eachus
1994-10-13 13:45 ` Norman H. Cohen
  -- strict thread matches above, loose matches on Subject: below --
1994-10-13 13:22 Keith Arthurs
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox