comp.lang.ada
 help / color / mirror / Atom feed
From: nabbasi@qualcomm.com (Nasser Abbasi)
Subject: Re: on OO differnces between Ada95 and C++
Date: 1996/02/22
Date: 1996-02-22T00:00:00+00:00	[thread overview]
Message-ID: <4gh204$l7n@qualcomm.com> (raw)
In-Reply-To: Dn4J2F.uI@bton.ac.uk

In article <Dn4J2F.uI@bton.ac.uk>, je@bton.ac.uk (John English) says:
>
>Nasser Abbasi (nabbasi@qualcomm.com) wrote:
>: Lets also assume that we need to define a Money Type, defined in
>: the base class Account.     
>
>: In Ada95 this type is defined in the package Account.ads that also
>: includes the definition of the tagged record type Account (along with
>: operations that act on Account type).
>
>: Now, In Ada95, a client that wishes to use Saving_Account type (and
>: any operations on it) will "with" the Saving_Account Package.


>
>If the spec of Saving_Account has "with Account" at the beginning,
>"with Saving_Account" will imply "with Account". 

I do not think this is true. That is the main reason I asked the 
question in the first place. (I did not like having to "with" 
a package that was allready with'ed by a package I am "withing" ).

If what you say was the case, then types defined in package "A"
will be seen by clients to a package "B" where "B" has with'ed A. But
it is not so. Clients of "B" must also 'with' "A" to see types defined
in "A" even though "B: has allready  with'ed "A".

Thanks all for your inputs, I see 2 solutions now to this. I like the
child package solution mentioned by a number of people (including
John English).

I also like the fact that withing Ada packages is not transitive. when
I "with" Package A, only what is in A is visible, and not every thing
that in the chain of packages that A might have "withed" (unless 
offcourse tagged types are involved). This way seems to give better 
control of things. In C/C++ including files A.h, will also "pull" in
everthing that is included by A.h to the client level and make
these things visible at the client level.. 

Nasser





  parent reply	other threads:[~1996-02-22  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-20  0:00 on OO differnces between Ada95 and C++ Nasser Abbasi
1996-02-20  0:00 ` Robert I. Eachus
1996-02-20  0:00 ` Norman H. Cohen
1996-02-21  0:00   ` Mark A Biggar
1996-02-22  0:00     ` Norman H. Cohen
1996-02-27  0:00   ` Adam Morris
1996-02-20  0:00 ` Jerome Desquilbet
1996-02-21  0:00   ` Robert Dewar
1996-02-22  0:00     ` Jerome Desquilbet
1996-02-24  0:00       ` Robert Dewar
1996-02-22  0:00   ` Pete Becker
1996-02-23  0:00     ` Jerome Desquilbet
1996-02-26  0:00     ` Darren C Davenport
1996-02-26  0:00       ` Pete Becker
1996-02-27  0:00         ` Nigel Perry
1996-02-21  0:00 ` Jon S Anthony
1996-02-21  0:00 ` John English
1996-02-22  0:00   ` Gene Ouye
1996-02-26  0:00     ` John English
1996-02-22  0:00   ` Nasser Abbasi [this message]
1996-02-26  0:00     ` John English
1996-02-27  0:00       ` Dale Stanbrough
1996-02-21  0:00 ` Darren C Davenport
  -- strict thread matches above, loose matches on Subject: below --
1996-02-21  0:00 Christian Jaensch, FRG
1996-02-26  0:00 Simon Johnston
replies disabled

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