Re: Passing a function to a function (TI89)


[Prev][Next][Index][Thread]

Re: Passing a function to a function (TI89)



>
> It appears that you would like to pass the _name_ of a function (e.g. "f")
> to a procedure (you use the name "myfunc") that would then evaluate this
> function, at 0 or at some other set of values. You could do this with the
> powerful but often-overlooked command "expr()".
>

Yes, but then I should have an string, that is, code like :

calling :

myfunc("f")

and myfunc defined as :

:myfunc(g)
:expr(g&"(0)")

I really wouldn't like to use this solution, as it won't work with what I'd
like to do.

> The problem is that I do not believe that this would be valid inside a defined
> _function_, as it would likely be considered to constitute a "side effect".

A side effect ? why ?

> There is no real reason why it could not be accomplished with a _program_ named
> "myfunc", however.

Well, my real problem is that I want to do a set of functions to work on
random
variables (I hope that's the name in english). That way, I could define the
mean
of a random variable to be integrate(x*f(x),x,-oo,oo) , where f(x) is the
parameter of the "mean" function that is, the density function of the
variable.
I cannot do that with a program (except if I draw the number to the output
screen or to a dialog, which wouldn't be "the right way" imho).

Greetings,

--
Antonio Larrosa Jimenez
Student of Mathematics
antlarr@arrakis.es
http://www.arrakis.es/~rlarrosa
Klein bottles for rent -- inquire within.

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************