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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a277322e4aa032bf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-30 05:10:25 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.158.233.21!news1.ebone.net!news.ebone.net!newsfeeds.net.uni-c.dk!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: math: passing function to function Date: Mon, 30 Apr 2001 14:10:24 +0200 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3AED5630.BDEAC1E2@nbi.dk> References: <9cjham$lu4$1@eol.dd.chalmers.se> NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.net.uni-c.dk 988632624 37248 130.225.212.55 (30 Apr 2001 12:10:24 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Mon, 30 Apr 2001 12:10:24 +0000 (UTC) X-Mailer: Mozilla 4.77 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: newsfeed.google.com comp.lang.ada:7043 Date: 2001-04-30T14:10:24+02:00 List-Id: Staffan: > I've tried using access to subprogram types to make something like > function solver(fun: access to function to solve; ...) return long_float; > which usually compiles ok, but exits raising > constraint error as soon as the code gets more involved than the > rudimentary examples given in the RM. Strange. Have you found out where the constraint error is raised? (in the "fun" or in "solver") > I would very much appreciate it if someone could point me to > some mathematical Ada source code where things like the above > are bound to be used. I think there should be an example in "Generic_Least_Squares" in the collection you can find at: http://hugin.ldraw.org/Ada/matematik/ > The latest line of thought is that it might be possible to > make a generic construction like > > generic > function fun(X:float) return float renames function_to_solve; > function solver(...) return float is > begin > ...... Have a look at 12.1(22) and 12.1(24) in the LRM. Jacob -- "hackers have almost lost interest in Windows NT exploits because they're becoming so common"