complex function works only after defining it twice
Subject: complex function works only after defining it twice
From: Robert Dodier
Date: Fri, 16 May 2008 20:13:48 -0600
On Fri, May 16, 2008 at 1:40 PM, Christoph Sarnowski
>> -- The functions you are defining (pt, tempfunc, etc.) will be defined
>> *globally*. Is that what you want?
>
> I found that out, too, and thought about doing remfunction() for those
> afterwards...
Not sure what you're doing, but I suspect lambda
expressions (unnamed functions) could be useful here.
e.g.
foo : lambda ([x, y], x^2 + y^2);
foo (12, b - a);
=> (b - a)^2 + 144
apply (foo, [12, b - a]);
=> (b - a)^2 + 144
> Hm, another very short way of achieving about the same
> thing... replacing del(a) by concat('delta_, a), this does what i need.
If you are trying to construct differentials of functions
of several variables, I think there is a package (maybe
pdiff) to do that kind of stuff. Also, maybe you should
try to use subscripted variables instead of distinguishing
variables by constructing symbols via concat; although
I'm not sure what you want here.
hope this helps
Robert Dodier