From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: math: passing function to function
Date: Mon, 30 Apr 2001 14:10:24 +0200
Date: 2001-04-30T14:10:24+02:00 [thread overview]
Message-ID: <3AED5630.BDEAC1E2@nbi.dk> (raw)
In-Reply-To: 9cjham$lu4$1@eol.dd.chalmers.se
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"
next prev parent reply other threads:[~2001-04-30 12:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-30 11:12 math: passing function to function Staffan Dittmer
2001-04-30 12:10 ` Jacob Sparre Andersen [this message]
2001-04-30 12:57 ` Marc A. Criley
2001-04-30 13:51 ` Staffan Dittmer
2001-04-30 14:38 ` Ted Dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox