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,WEIRD_PORT 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 Date: Sun, 03 Feb 2008 20:27:52 +0100 From: Gautier 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> In-Reply-To: <47a609b8$0$23664$4d3efbfe@news.sover.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.76.184.193 X-Original-NNTP-Posting-Host: 83.76.184.193 Message-ID: <47a615cc$1_4@news.bluewin.ch> X-Trace: news.bluewin.ch 1202066892 83.76.184.193 (3 Feb 2008 20:28:12 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.germany.com!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news1.google.com comp.lang.ada:19698 Date: 2008-02-03T20:27:52+01:00 List-Id: Peter C. Chapin: ... > GNAT says this: > > check.adb:3:14: missing body for "Sqrt" declared at check.ads:5 > check.adb:21:13: "Sqrt" conflicts with declaration at check.ads:5 > check.adb:21:13: instantiation cannot provide body for it > > The first message I understand. The last two I'm not clear about. Is > GNAT telling me that my declarations conflict in some way and because of > that it can't do the instantiation, or is the instantiation the *cause* > of the conflict? Is it possible to do what I'm trying to do here? 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; 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 check.adb: Error: line 27 col 1 LRM:3.11.1(6), Completion required for specification 'Sqrt', Continuing Front end of ..\..\check.adb failed with 2 errors. " ______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!