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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,57fc00da1adfa079,start X-Google-Attributes: gid103376,public From: Ted Dennison Subject: LLQ: Scope and child package names Date: 2000/08/10 Message-ID: <8mv91i$bfr$1@nnrp1.deja.com>#1/1 X-Deja-AN: 656926720 X-Http-Proxy: 1.0 x53.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Aug 10 22:06:46 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-08-10T00:00:00+00:00 List-Id: My compiler's giving me some suprising (to my small mind) results in this area, so I'd like to find out what the actual rules are in this area. Say I have two child packages, one of which "with"s the other. Let's further stipulate that the name of the with-ee's parent happens to be the same as the name of the with-or. For example: package Foo.Utility is type Instance is... ... end Foo.Utility; with Foo.Utility; package Facility.Foo is ... type Instance is new Foo.Utility.Instance; end Facility.Foo; My compiler gacks at this, saying Utility is not found in Foo. I'm guessing the problem is that "Foo" inside of Facility.Foo is a shorthand for Facility.Foo, hiding any "Foo" package hierarchy I may have with'ed. Is that right? Question 2: It just so happened that I had a rename for the with-ee parent around. So I tried using that, expecting failure becuase I had no such rename for the child package. But to my suprise, it worked! Eg: package Executive_Foo renames Foo; with Executive_Foo.Utility; package Facility.Foo is ... type Instance is new Executive_Foo.Utility.Instance; end Facility.Foo; This compiled happily. So a rename of a package effectively acts as a rename for all its children too? -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.