second order functions?



On Tue, May 13, 2008 at 9:26 AM, Joachim De Beule
<joachim at arti.vub.ac.be> wrote:
> Hi all,
>
>  I was wondering how to define a second order function in maxima, i.e. a
>  function returning a function.

There are several ways.  Unfortunately, depending on lexical scope is
not one of them, since Maxima doesn't support lexical scope.

As Barton says, you can use funmake.  Another way is to use "subst":

        subst([val=n], lambda([x],val+x) )

This has the advantage/disadvantage of specifying exactly which
variables you want to substitute.

What exactly are you trying to accomplish using second-order
functions?  Though they're certainly a powerful and appropriate
technique for many applications, often in Maxima it is easier to use
expressions than functions.

           -s