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,b6d543b1cb62702 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: package child question Date: 2000/02/08 Message-ID: #1/1 X-Deja-AN: 582943679 Content-transfer-encoding: 7bit References: <87mugk$sa3$1@news-hrz.uni-duisburg.de> Content-Type: text/plain; charset="US-ASCII" X-ELN-Date: Mon Feb 7 18:44:03 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 949977843 38.26.193.168 (Mon, 07 Feb 2000 18:44:03 PST) Organization: EarthLink Network, Inc. Mime-version: 1.0 NNTP-Posting-Date: Mon, 07 Feb 2000 18:44:03 PST Newsgroups: comp.lang.ada Date: 2000-02-08T00:00:00+00:00 List-Id: In article <87mugk$sa3$1@news-hrz.uni-duisburg.de> , sb463ba@d250-hrz.uni-duisburg.de (Georg Bauhaus) wrote: > with A.B; > package body B.A is > > begin > declare > use A.B; -- compiler says: "B" not declared in "A" > begin > null; > end; > end B.A; > > This only happens if the use clause is in A.B body statements, > there is no error message when it is in the context clause of A.B. A name always denotes the entity with the most inner scope. In your case, the name "A" denotes the package B.A, because that is the A-entity declared in the most inner scope. > Is there a way out of this, other than choosing different names > (which works)? You could try doing a library-level package renames: -- this is its own file, say ab.ads package AB renames A.B; -- now with the renamed package: with AB; package body B.A is begin declare use AB; begin null; end; end B.A; I haven't tried compiling this, though. -- Celebrate Darwin Day on Saturday, 12 February!