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,814577151c84863d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-17 21:00:09 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: which compiler is right? Date: Wed, 17 Mar 2004 22:57:42 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <105ib2sanngpi0f@corp.supernews.com> References: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:6390 Date: 2004-03-17T22:57:42-06:00 List-Id: wrote in message news:mailman.104.1079549636.327.comp.lang.ada@ada-france.org... ... > For the record, here is how I use those packages: > I provide the concrete realization of Priority by renaming > the one in the generic instantiation. > > with Pkg1; > package Pkg3 is > type T_Event is new Pkg1.T_Event with null record; > function Priority (Event : in T_Event) return Natural; > end Pkg3; > > > with Pkg2; > package body Pkg3 is > package Pkg2_Instanciation is new Pkg2 (T_Event); > function Priority (Event : in T_Event) return Natural > renames Pkg2_Instanciation.Priority; > end Pkg3; You don't need to have the same name of routine for this purpose, and it probably would less confusing (both to language lawyers and to readers of your code) if the name was different in the generic. That is, if the generic looked like: generic type T_Event (<>) is new Pkg1.T_Event with private; package Pkg2 is function Priority_Implementation (Event : in T_Event) return Natural; end Pkg2; with Pkg2; package body Pkg3 is package Pkg2_Instanciation is new Pkg2 (T_Event); function Priority (Event : in T_Event) return Natural renames Pkg2_Instanciation.Priority_Implementation; end Pkg3; gives you exactly what you want, without running into obscure language bugs. Randy.