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.8 required=5.0 tests=BAYES_00,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible ! Date: Sun, 8 Apr 2018 08:50:16 +0200 Organization: Adalog Message-ID: References: <115d2e72-2b30-4ec0-b42f-52e9df2905d4@googlegroups.com> NNTP-Posting-Host: XdjV4tYMtFfMKGpv0MuDzQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Openpgp: preference=signencrypt X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:51396 Date: 2018-04-08T08:50:16+02:00 List-Id: Le 08/04/2018 à 02:32, Mehdi Saada a écrit : > I just realized one can't do that: > > generic > with procedure instance_of_generic_procedure is new generic_procedure; > ... Of course - because it would be useless. The only thing you know from the specification of a generic subprogram is its profile, and you can import any procedure with an appropriate profile. While restrict to those that are in addition an instantiation of a given generic? You have been mistaken by the case of packages. While it is easy to define the matching of subprograms, the matching of packages would be almost impossible to define - unless the package in an instantiation of a generic, in which case it obviously matches the generic. When Ada95 was designed, there was a demand for passing packages the same way as subprograms (already present in Ada83). It appeared that this was possible only for packages that were built from the same generic. There is no such problem with subprograms. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr