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!feeder.eternal-september.org!aioe.org!.POSTED.6k1R0IQgF+3y+m4EkNohlQ.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: generic with function procedure Date: Fri, 12 Jun 2020 17:45:32 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <2bbd5c7c-78da-4127-b85a-eeb3f9651456o@googlegroups.com> <3a31389d-d554-46f5-930e-495192b1fbcbo@googlegroups.com> NNTP-Posting-Host: 6k1R0IQgF+3y+m4EkNohlQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:a8NzlhMqRRPCeZHc0shASacPNrk= Xref: reader01.eternal-september.org comp.lang.ada:59064 Date: 2020-06-12T17:45:32+01:00 List-Id: Gilbert Gosseyn writes: > Apparently the problem is solved when I make the parameter list for f, > g, and h the same. (it must be a well known fact when using more than > one with. However, I missed it). Thanks to all contributors. If you'd posted this question on the [ada] tag on StackOverflow, we'd have probably closed the question because you haven't shown us the code that you couldn't get to work! Show us the original failing declarations of F, G, and H and then we can tell you more. It is most definitely *not* a "well known fact" that the parameter lists of all subprogram arguments to a generic have to be the same. In fact, that suggestion is completely false. Simple compiling demo: procedure Vogt is subtype Real is Float; type Real_Vector is array (1 .. 10) of Real; generic with function F(V : Real_Vector) return Real; with function G(J : Integer; V : Real_Vector) return Real; with function H(J : Integer; V : Real_Vector) return Real; procedure Denm (Np,Q,N,M : Integer); procedure Denm (Np,Q,N,M : Integer) is null; function F1 (V : Real_Vector) return Real is (42.0); function G1 (J : Integer; V : Real_Vector) return Real is (42.0); function H1 (J : Integer; V : Real_Vector) return Real is (42.0); procedure Nm is new Denm (F => F1, G => G1, H => H1); begin null; end Vogt;