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!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!au2pb.net!feeder.erje.net!us.feeder.erje.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Function definitions Date: Fri, 20 Jun 2014 16:39:31 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <610b9d5b-a9a5-464d-9de3-b2f754f58cff@googlegroups.com> <7597c304-0dc2-41ad-b04e-1aef133e5b63@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1403296748 24772 192.74.137.71 (20 Jun 2014 20:39:08 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 20 Jun 2014 20:39:08 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:sTDKKhqwrMtPWAO2R6MGfFJdryw= Xref: news.eternal-september.org comp.lang.ada:20482 Date: 2014-06-20T16:39:31-04:00 List-Id: montgrimpulo writes: > P,Q,R : Natural; > > type Individual is record > X : x_array (0..P); > Y : y_array (0..Q); > Z : z_array (0..R); > end record; That won't work. P, Q, and R are not initialized yet. Assigning into them later won't suddenly change the lengths of those arrays. I think you want a discriminated record, as in: type Individual(P, Q, R : Natural) is record ... > This is in principle what I want to set up and run, while I want to be > flexible in defining F and G and other parameters, without having to > modify the files search.ads and search.adb. So you want (for example) P1 to call different versions of F? If so, then you can pass F into P1: procedure P1(F: not null access function (...) return ...); Then the body of P1 can call F: procedure P1(F: not null access function (...) return ...) is XYZ : ... := F(...); begin ... When you call P1, you create a function My_F, and pass My_F'Access to P1: P1(F => My_F'Access); - Bob