make_lambda function to construct a lambda expression
Subject: make_lambda function to construct a lambda expression
From: Robert Dodier
Date: Fri, 11 May 2007 10:07:57 -0600
On 5/11/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> On 5/11/07, Robert Dodier <robert.dodier at gmail.com> wrote:
> > I wonder what anyone thinks of Maxima having a built-in
> > function to construct a lambda expression....
> > F (a) := make_lambda (['x], 'x * a);
>
> Why is this better than funmake( 'lambda,['[x], 'x*a ]) ?
(1) "A function to return a function" is an interesting & useful concept.
(2) The need to use funmake or some other operator here is a
consequence of Maxima's evaluation policy for lambda, which is
obscure.
> > Here is a possible implementation of make_lambda.
> > make_lambda (v, expr) := buildq ([v, expr], lambda (v, expr));
>
> I think you mean "::=" here -- buildq is specifically designed for use in
> macros and quotes its arguments (hence the "q" in its name).
No, := is intended here. I want make_lambda to evaluate its
arguments in the ordinary way. A Lisp DEFUN would work too.
Robert