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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,daf6d89212a75f42 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!out03a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Sun, 03 Feb 2008 14:46:23 -0500 From: "Peter C. Chapin" User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Using a generic instance to implement a public subprogram? References: <47a609b8$0$23664$4d3efbfe@news.sover.net> <47a615cc$1_4@news.bluewin.ch> In-Reply-To: <47a615cc$1_4@news.bluewin.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <47a61a1f$0$23713$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 00cccf79.news.sover.net X-Trace: DXC=H]fK_]QY863=RT:S6`J8?5K6_LM2JZB_3Bf\S@>Ud`==3?@`i3kGa5;C9EeRcf@T25CnRjbhPD]d3 X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:19699 Date: 2008-02-03T14:46:23-05:00 List-Id: Gautier wrote: > No idea whether GNAT is right or not, but the following works (I came > across the same problem at least one time...): > > function Sqrt_internal is > new Unary_Operation(Operation => Elementary_Functions.Sqrt); > > function Sqrt(V : Vector) return Vector > renames Sqrt_internal; Cool. I'll give that a try. > Note that the compilation of your code with ObjectAda 7.2.2 fails too; > it says the following: > " > check.adb: Error: line 21 col 13 LRM:8.3(26), Illegal to override > declaration in same region, Introducing new declaration anyway So it seems like the instantiation is regarded as a different thing than the subprogram mentioned in the specification. Yet because it has the same profile as the subprogram in the specification it "conflicts" with that earlier declaration. ObjectAda's use of the word "override" seems confusing; I don't think this has anything to do with overriding primitive operations. Or does it? Hmmm. Thanks for your suggestion. Peter