Embedding maxima



[Peter Scott , Fri, 25 Feb 2005 11:31:03 -0700]:
> Ideally, I wish that I could do something like this:
> 
> (maxima:integrate "3*x^2" 'x 2 5)

I think to do that you can use the #$ ... $ reader syntax:

,----
| (%i1) to_lisp();
| 
| 
| ; In: LAMBDA (CONDITION ME-OR-MY-ENCAPSULATION)
| 
| ;   #'(LAMBDA (CONDITION ME-OR-MY-ENCAPSULATION)
| ;       (BLOCK MAXIMA-LISP-DEBUGGER-REPL # # #))
| ; Note: Variable ME-OR-MY-ENCAPSULATION defined but never used.
| Type (to-maxima) to restart
| 
| MAXIMA> #$integrate(3*x^2, x, 2, 5)$
| 117
`----

This much is simple because you only want a numerical result and
because this code does not depend on the result of some Lisp
computation.  As for more general situations I don't know anything,
but I assume that the definition of translate is relevant.

Albert.