comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
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
Date: 2018-04-08T08:50:16+02:00	[thread overview]
Message-ID: <pace35$hbe$1@gioia.aioe.org> (raw)
In-Reply-To: 115d2e72-2b30-4ec0-b42f-52e9df2905d4@googlegroups.com

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


  reply	other threads:[~2018-04-08  6:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08  0:32 no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible ! Mehdi Saada
2018-04-08  6:50 ` J-P. Rosen [this message]
2018-04-09 23:43   ` Shark8
2018-04-08 11:15 ` Mehdi Saada
2018-04-08 11:46   ` Jere
2018-04-08 13:47     ` Mehdi Saada
2018-04-12  8:56 ` Marius Amado-Alves
2018-04-12 10:14   ` Mehdi Saada
2018-04-13  0:37     ` Shark8
2018-04-13 12:34       ` Mehdi Saada
2018-04-13 15:57         ` Mehdi Saada
2018-04-13 23:59           ` Randy Brukardt
2018-04-14  0:00         ` Randy Brukardt
2018-04-14  6:00           ` Mehdi Saada
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox