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,FREEMAIL_FROM, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.133.101 with SMTP id h98mr559976iod.51.1523317412429; Mon, 09 Apr 2018 16:43:32 -0700 (PDT) X-Received: by 2002:a9d:3286:: with SMTP id u6-v6mr812960otb.13.1523317411979; Mon, 09 Apr 2018 16:43:31 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!k65-v6no2280226ita.0!news-out.google.com!15-v6ni1262itg.0!nntp.google.com!k65-v6no2280225ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 9 Apr 2018 16:43:31 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.113.16.86; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 76.113.16.86 References: <115d2e72-2b30-4ec0-b42f-52e9df2905d4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0a981aae-2429-4195-a7aa-ee5e6da05110@googlegroups.com> Subject: Re: no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible ! From: Shark8 Injection-Date: Mon, 09 Apr 2018 23:43:32 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:51427 Date: 2018-04-09T16:43:31-07:00 List-Id: On Sunday, April 8, 2018 at 12:50:15 AM UTC-6, J-P. Rosen wrote: > Le 08/04/2018 =C3=A0 02:32, Mehdi Saada a =C3=A9crit=C2=A0: > > I just realized one can't do that: > >=20 > > 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? The idea behind my proposal for automatic/default instantiation was address= ing this, as well as allowing the formal parameters to direct the implicit = instantiation. GENERIC TYPE Parameter_Type IS (<>); PROCEDURE Generic_Swap( A, B : Parameter_Type ); PROCEDURE Generic_Swap( A, B : Parameter_Type ) IS C : Constant Parameter_Type:=3D A; BEGIN A:=3D B; B:=3D C; END Generic_Swap; GENERIC TYPE Something IS (<>); USE PROCEDURE Swap IS NEW Generic_Swap( Parameter_Type =3D> Something ); PACKAGE Example IS --... END Example; Which would allow a more uniform syntax, which is what this seems to be abo= ut, as well as allow Example.Swap to be implicitly instantiated the instant= iation of Example. > 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. >=20 > 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. There was an extension in the iAPX 432 of "Package Types" that have an inte= resting correlation to this demand, IMO -- if you want to kno more, here's = the manual: http://bitsavers.informatik.uni-stuttgart.de/components/intel/= iAPX_432/172283-001_Reference_Manual_for_the_Intel_432_Extensions_to_Ada_De= c81.pdf