different behaviour of lambda() inside and outside functions
Subject: different behaviour of lambda() inside and outside functions
From: Robert Dodier
Date: Wed, 9 May 2007 18:38:14 -0600
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