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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.nobody.at!texta.sil.at!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 15 Apr 2014 23:28:47 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with generic package References: <1ffb84f0-5e50-4807-90ff-dfdfac11c501@googlegroups.com> <596f076f-919e-4cd2-bb2e-ad0134e0d5c3@googlegroups.com> <3c4668e7-73f6-4a99-a96d-619639ea49e8@googlegroups.com> In-Reply-To: <3c4668e7-73f6-4a99-a96d-619639ea49e8@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <534da490$0$6697$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 15 Apr 2014 23:28:48 CEST NNTP-Posting-Host: c8380935.newsspool2.arcor-online.net X-Trace: DXC=aTWG6XeKBH6TQL:hoD@>T?A9EHlD;3Yc24Fo<]lROoR18kFPCY\c7>ejV8XdLGJfn3\J>YbUFG2PUFE7 X-Complaints-To: usenet-abuse@arcor.de Xref: news.eternal-september.org comp.lang.ada:19323 Date: 2014-04-15T23:28:48+02:00 List-Id: On 15/04/14 22:12, Laurent wrote: > Hi > > Hm yes and no. I am trying to get rid of Swap_Generic and Sort_Generic. Trying to combine those together with my generic search function in one generic package: array_generics (stupid name have to find something else). Have just posted them for completeness but forgotten to write it (if its clear for me doesn't mean it is for someone else). > > Sorry for the confusion. > > If I leave the swap_generic.ads and with'ing it, comment the swap in the array_generic.adb out then the instantiation works without changing anything else. > > If I remove the swap_generic.adb from the library folder, remove the with'ing, reload project... > and try to instantiate the swap_generic from the package I get this error: > > expect generic subprogram in instantiation. I think the confusion is elsewhere. The package Array_Generics, declared in Array_Generics.ads, and the declarations in Swap_Generic.ads are not related at all, since Array_Generics does not "with" Swap_Generic. It does, however, declare a procedure of the same name, Swap_Generic, which is a plain procedure. A plain procedure cannot be instantiated, as others have noted. Briefly, using one-letter names, you have a.ads declaring generic procedure a, (1) p.ads declaring generic package p with some a in it (2) Now, a from (1) and a from (2) are unrelated, they just happen to be both named a. Maybe you had a from (1) in mind when you effectively tried to instantiate a from (2).