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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7cc62a3e4497b0b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-11 11:31:05 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cse.psu.edu!uwm.edu!htc.honeywell.com!not-for-mail From: Steve Vestal Newsgroups: comp.lang.ada Subject: Re: Q: generic children of generic packages? Date: 11 Jun 2001 13:29:47 -0500 Organization: Honeywell Technology Center, Mpls. MN, USA. Sender: vestal@grinch.htc.honeywell.com Message-ID: References: <%b7V6.4043$pb1.154477@www.newsranger.com> NNTP-Posting-Host: grinch.htc.honeywell.com X-Newsreader: Gnus v5.4.37/XEmacs 19.16 Xref: archiver1.google.com comp.lang.ada:8568 Date: 2001-06-11T13:29:47-05:00 List-Id: Here's what I tried, with the error messages included as comments. The problem seems to occur in the attempt to instantiate the generic child package. Any suggestions would be most appreciated. generic package Generic_Parent is type Hidden_Type is private; procedure Frobulate (HT: in out Hidden_Type); private type Hidden_Type is new Integer; end Generic_Parent; package body Generic_Parent is procedure Frobulate (HT: in out Hidden_Type) is begin HT := HT + 1; end; end Generic_Parent; generic package Generic_Parent.Generic_Child is procedure Pre_Frobulate (HT: out Hidden_Type); end Generic_Parent.Generic_Child; package body Generic_Parent.Generic_Child is procedure Pre_Frobulate (HT: Hidden_Type) is begin HT := 0; end; end Generic_Parent.Generic_Child; with Generic_Parent; package Parent is new Generic_Parent; with Parent; -- parent-child.ads:5:35: "Generic_Child" not declared in "Parent" -- Can also try the following, with following results. --with Parent.Generic_Child; -- main.adb:2:06: file "parent-generic_child.ads" not found package Parent.Child is new Parent.Generic_Child; with Parent; with Parent.Child; procedure Main is HT: Parent.Hidden_Type; begin Parent.Child.Pre_Frobulate (HT); Parent.Frobulate (HT); end Main;