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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ac62ca34a465706 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,9ac62ca34a465706 X-Google-Attributes: gid109fba,public From: nabbasi@qualcomm.com (Nasser Abbasi) Subject: Re: on OO differnces between Ada95 and C++ Date: 1996/02/22 Message-ID: <4gh204$l7n@qualcomm.com>#1/1 X-Deja-AN: 140570988 references: <4gbq7q$g08@qualcomm.com> organization: QUalcomm Inc. reply-to: x!news.be.innet.net!INbe.net!usenet newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-02-22T00:00:00+00:00 List-Id: In article , 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