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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a05:6214:18c9:: with SMTP id cy9mr12473174qvb.77.1591972168936; Fri, 12 Jun 2020 07:29:28 -0700 (PDT) X-Received: by 2002:aca:c683:: with SMTP id w125mr2293672oif.37.1591972168656; Fri, 12 Jun 2020 07:29:28 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 12 Jun 2020 07:29:28 -0700 (PDT) In-Reply-To: <3a31389d-d554-46f5-930e-495192b1fbcbo@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: <2bbd5c7c-78da-4127-b85a-eeb3f9651456o@googlegroups.com> <3a31389d-d554-46f5-930e-495192b1fbcbo@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7683dd8f-73c9-4c18-b198-a574759e4e24o@googlegroups.com> Subject: Re: generic with function procedure From: Shark8 Injection-Date: Fri, 12 Jun 2020 14:29:28 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:59063 Date: 2020-06-12T07:29:28-07:00 List-Id: On Wednesday, June 10, 2020 at 2:21:13 AM UTC-6, Gilbert Gosseyn wrote: > On Tuesday, June 9, 2020 at 6:44:13 PM UTC+2, Shark8 wrote: > > Now, at this point the compiler cannot do anything more: this is the re= alm where only the human programmer can tell what to do: > > =E2=80=94 Is it a copy and paste-error creating the functions "g" and "= h"? (Were they declared in the form of "f" which is "(v : Real_Vector) retu= rn Real;" instead of "(j : Integer; v : Real_Vector) return Real;"?) > > =E2=80=94 Did you perhaps mean to make the formal parameters of denm, "= g" and "h", to be "(v : Real_Vector) return Real;" instead of "(j : Integer= ; v : Real_Vector) return Real;"? (Perhaps being interrupted while refactor= ing it, and it's stuck in a form intermediate between what you had and what= you want.) > > =E2=80=94 Did you forget to make a "g1" and "h1"? >=20 > Apparently the problem is solved when I make the parameter list for f, g,= and h the same. But is it? Take a look at the first point I raised: * Is it a copy and paste-error creating the functions "g" and "h"? IOW, which is appropriate? A function with signature "(v : Real_Vector) ret= urn Real;", or a function with signature "(j : Integer; v : Real_Vector) re= turn Real;"? > It must be a well known fact when using more than one with. However, I mi= ssed it. It doesn't really have to do with WITH, but with (a) the generic's formal d= eclaration, and (b) the functions visible at instantiation... WITH is only = relevant here when using it to pull compilation units into visibility, but = even that can be blocked/overriden (e.g.) by locally declaring a function o= f the same name.