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 10.182.20.17 with SMTP id j17mr1847713obe.24.1403282602281; Fri, 20 Jun 2014 09:43:22 -0700 (PDT) X-Received: by 10.50.128.108 with SMTP id nn12mr100138igb.1.1403282602118; Fri, 20 Jun 2014 09:43:22 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!uq10no1183126igb.0!news-out.google.com!gf2ni11igb.0!nntp.google.com!hn18no2517634igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 20 Jun 2014 09:43:21 -0700 (PDT) In-Reply-To: <5a8316fb-9b3d-405b-8199-edcaf18dcaa6@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <610b9d5b-a9a5-464d-9de3-b2f754f58cff@googlegroups.com> <5a8316fb-9b3d-405b-8199-edcaf18dcaa6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Function definitions From: Adam Beneschan Injection-Date: Fri, 20 Jun 2014 16:43:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20473 Date: 2014-06-20T09:43:21-07:00 List-Id: On Friday, June 20, 2014 9:22:30 AM UTC-7, montgrimpulo wrote: > My modified question: >=20 > Hi, >=20 > What would be an answer to the following question: > There are three files : search.ads, search.adb, main_search.adb. >=20 > In search.ads two functions are defined: function F and function G, as > =20 > function F (V : Individual) return Long_Float; and > function G(M : Natural; V : Individual) return Long_Float; >=20 > Individual is defined as a Record containing several arrays > with a size determined by variables, eg .=20 >=20 > type Individual is record > X : x_array (0 .. P); > Y : y_array (0 .. Q); > Z : z_array (0 .. R); > end record; > > In search.adb there are several procedures using the functions F and G de= fined in search.ads. >=20 > The general search procedure g_search (P, Q, R) (defined in search.adb) i= s called in main_search.adb.=20 >=20 > As I want to define the internal statements of F and G, and other parame= nters, (eg. P,Q,R), only in file main_search.adb, I don't know how to defin= e F and G in search.ads / search.adb, as their body is claimed to be missin= g in search.adb. >=20 > I hope that description is sufficient to answer my question on how to def= ine F and G, so that I can use > the general search procedure g_search with many different versions of F a= nd G ? I apologize, but I still cannot figure out what you are asking. My problem= is that you're using phrases that don't seem to have any clear connection = with Ada concepts. What do you mean by "many different versions of F and G= "? If you define a procedure, you're defining only one procedure; you can'= t normally have many different versions of the same procedure. Are you try= ing to define an access-to-procedure type that can be used with a number of= different search procedures? Are you trying to use a generic? Why do you= want one function definition but many versions? What are you planning on = doing with the definition. It looks like you have some code that isn't compiling. I would suggest you= post the *entire* code that you have so far. Even if it's not proper Ada,= it might show us what you're trying to accomplish. Your description is no= t sufficient, and you probably cannot make it sufficient by just trying to = use more words to describe it. Sorry. -- Adam