comp.lang.ada
 help / color / mirror / Atom feed
From: Steve Vestal <vestal@htc.honeywell.com>
Subject: Re: Q: generic children of generic packages?
Date: 11 Jun 2001 13:29:47 -0500
Date: 2001-06-11T13:29:47-05:00	[thread overview]
Message-ID: <vc566e250pw.fsf@grinch.htc.honeywell.com> (raw)
In-Reply-To: %b7V6.4043$pb1.154477@www.newsranger.com

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;





  reply	other threads:[~2001-06-11 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-11 16:35 Q: generic children of generic packages? Steve Vestal
2001-06-11 17:27 ` Ted Dennison
2001-06-11 18:29   ` Steve Vestal [this message]
2001-06-11 18:41     ` Ed Falis
2001-06-11 18:55     ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox