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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,9ac62ca34a465706 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,9ac62ca34a465706 X-Google-Attributes: gid103376,public From: je@bton.ac.uk (John English) Subject: Re: on OO differnces between Ada95 and C++ Date: 1996/02/26 Message-ID: #1/1 X-Deja-AN: 141190983 references: <4gbq7q$g08@qualcomm.com> <4gh204$l7n@qualcomm.com> organization: University of Brighton, UK followup-to: comp.lang.ada,comp.lang.c++ newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-02-26T00:00:00+00:00 List-Id: Nasser Abbasi (nabbasi@qualcomm.com) wrote: : In article , je@bton.ac.uk (John English) says: : >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" ). Hmm. I've been having another look at the visibility rules in the LRM and, as usual, they've made my head go round and round :-) Certainly GNAT allows you to reference Account.X if you have "with Saving_Account" (but I'm all too aware that GNAT /= Ada95 :-), although the same is not true for "use" clauses ("use Saving_Account" does not imply "use Account"). Remember that I'm talking about *with clauses in package specifications* and not use clauses *or* package bodies (in case there is any confusion about this). : 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". If you're right this would be a real pain. Clients of a package would have to know (recursively) what other packages the spec(s) reference; if the spec for X "withs" a package Y so it can use type Y.T as a procedure parameter then you wouldn't be able to use X without Y (i.e. "with X" on its own would be useless; you'd have to have "with X, Y" and probably other things as well if Y has any "with" clauses in its specification. This is such a horrible concept that I'm inclined to believe GNAT, but if anyone who can understand all the subleties of the visibility rules can give us all a definitive explanation in words of sufficiently few syllables that Bears of Very Little Brain like me can understand, I for one would be profoundly grateful. -- ---------------------------------------------------------------------------- John English , Dept. of Computing, University of Brighton "Disks are divided into sex and tractors..." ----------------------------------------------------------------------------