Re: Passing a function to a function (TI89)


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

Re: Passing a function to a function (TI89)



Antonio Larrosa <antlarr@ARRAKIS.ES> writes:

> Hello,
>
> I have a TI89, and would like to know how to pass a function
> to a function I'm doing.
>
> Something like :
>
> 4*x->f(x)
>                Done
> myfunc(f(x))
>                   0
>
> and myfunc already defined as:
> :myfunc(g(x))
> :g(0)
>
> The problem is that it doesn't work this way, and I couldn't
> find in the manual how to do it.
>
> Of course, this is a simplified problem (not that I want to
> evaluate it at 0 :-) ), but it shows what I ask.
>
> Thanks.

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()".

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".
There is no real reason why it could not be accomplished with a _program_ named
"myfunc", however.

RWW Taylor
National Technical Institute for the Deaf
Rochester Institute of Technology
Rochester NY 14623

>>>> The plural of mongoose begins with p. <<<<

******************************************************************
* 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
******************************************************************