[Maxima] different behaviour of lambda() inside and outside functions

Robert Dodier robert.dodier at gmail.com
Wed May 9 19:38:14 CDT 2007


On 5/9/07, andre maute <andre.maute at gmx.de> wrote:

> I'm relatively new to Maxima,
> but is it intended behaviour that lambda behaves differently
> if it is called within a function?
>
> I have attached my little test script and
> a .txt file containing the output
>
> scaled_u and the last h are different

As pointed out by Stavros, the '' operator causes a substitution
when the function body is parsed, not at run time.
I find that replacing the assignment to f in myScaled
with

f : buildq ([v, h], lambda (v, h))

does yield scaled_u the same as the final h.

buildq is a parallel substitution function which does not evaluate
the expression to be substituted into.

HTH
Robert Dodier


More information about the Maxima mailing list