|
From: Stavros M. <mac...@gm...> - 2022-11-21 23:59:04
|
Maxima currently supports only dynamic scope.
You can simulate lexical scope using *buildq*, which is pretty much
equivalent to backquote:
F: lambda([a], buildq([a], lambda([b], 10*a+b)))$
F(3) => lambda([b],10*3+b)
F(3)(5) => 35
This is admittedly ugly.
-s
On Mon, Nov 21, 2022 at 6:51 PM Eduardo Ochs <edu...@gm...> wrote:
> Hi list,
>
> what is right & recommended way to write curried functions in Maxima?
> For example, in a first moment I though that this
>
> F : lambda([a], lambda([b], 10*a+b));
> F(2)(3);
>
> would yield 23, but the result was 10*a+3...
>
> Or: is there a simple way to do backquoting in Maxima? What are your
> favorite ways to rewrite this - that is lisp-ish pseudocode -
>
> F : lambda([a], `lambda([b], 10*,a+b));
>
> into real Maxima code?
>
> Thanks in advance!
> Eduardo Ochs
> http://angg.twu.net/eev-maxima.html
>
>
> _______________________________________________
> Maxima-discuss mailing list
> Max...@li...
> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>
|