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: 103376,3bb18a1e628df747 X-Google-Attributes: gid103376,public From: Chad Bremmon Subject: Re: Visibility of package within package Date: 1996/08/01 Message-ID: <32009A4C.147C@comm.hq.af.mil>#1/1 X-Deja-AN: 171554854 references: <4tnv8b$6v0@gateway.marconi.ca> content-type: text/plain; charset=us-ascii organization: SAM-GAPR mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01Gold (WinNT; I) Date: 1996-08-01T00:00:00+00:00 List-Id: Tucker Taft wrote: > > Erik Masella (emasella@mtl.marconi.ca) wrote: > > : Could anybody explain to me why the following will not work: > > : with Generic_Pkg; > : package A_Pkg is > : package B_Pkg is new Generic_Pkg(...); > : .. > : end A_Pkg; > > : -------------------------------- > > : with A_Pkg; > : package body C_Pkg is > : procedure Init is > : begin > : A_Pkg.B_Pkg.Do_Something(...); > : end Init; > : end C_Pkg; > > : ==> Why isn't B_Pkg visible within C_Pkg? From what I understand, > : "Software Engineering with Ada" from Booch (2nd ed.) says at p.383 that > : this is possible (but he did not use generics). > > : I'd greatly appreciate some insight into this. > > Your code looks OK, but it is hard to be sure without a complete > example, since we don't know what is inside "Generic_Pkg". When > you have mysteries like this, it is most useful to include an > actual listing with error messages from the compiler. Surprisingly > often, there is some other problem than the one you first suspect. > > In any case, it is possible that the compiler has a bug, but your > example is so simple and straightforward that it seems more likely > that something else is wrong. Don't you still have to with in "With A_Pkg.BPkg;" inside of your C_Pkg ? Chad > > : Erik Masella > : emasella@mtl.marconi.ca > > -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ > Intermetrics, Inc. Cambridge, MA USA