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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac5c3bc59168d76 X-Google-Attributes: gid103376,public From: ncohen@watson.ibm.com (Norman H. Cohen) Subject: Re: Subprogram Renaming Date: 1996/04/15 Message-ID: <4ktjud$qnf@watnews1.watson.ibm.com>#1/1 X-Deja-AN: 147593222 distribution: world references: <4kjhg2$139s@watnews1.watson.ibm.com> <316E12F2.37BC@ehs.ericsson.se> <4kmgha$139s@watnews1.watson.ibm.com> organization: IBM T.J. Watson Research Center reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada Date: 1996-04-15T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: |> Why not just: |> |> procedure Remove_All (Stack: in out Stack_Type) |> renames Inner.Remove_All; |> |> ? That won't work. Inner.Remove_All has a Stack_Parent_Type parameter, not a Stack_Type parameter. The derived-type declaration for Stack_Type itself must be in the outer declarative region, where the private type declaration is. Thus the subprogram being renamed is not the one declared in the inner package, but the one derived from that in the outer package. package Integer_Stacks is type Stack_Type is private; ... procedure Remove_All (Stack: in out Stack_Type); private package Inner is type Stack_Parent_Type is new Integer_Dequeues.Dequeue_Type; procedure Parent_Remove_All (Stack: Stack_Parent_Type) renames Remove_All; ... end Inner; type Stack_Type is new Inner.Stack_Parent_Type; procedure Remove_All (Stack: in out Stack_Type) renames Parent_Remove_All; -- Inherited from Inner.Remove_All end Integer_Stacks; -- Norman H. Cohen ncohen@watson.ibm.com