On 11/20/07, Robert Gloeckner <Robert.Gloeckner at gmx.net> wrote:
> I read Daniels post about Efficient Lisp functions
> (http://www.math.utexas.edu/pipermail/maxima/2007/008152.html), which
> shows a way to do so. I am wondering if there is a standard/preferred
> way to do so.
Robert, I'm not sure what you want to accomplish, but here are
some ideas. Calling Lisp from Maxima: just write your Lisp code as
an ordinary (defun $foo ...), load the code via load("foo.lisp") in Maxima,
and call the code from Maxima like an ordinary function foo(...).
Arguments supplied from Maxima are Maxima expressions,
typically ((bar) x y z) where bar is an operator or function name.
E.g. a Maxima list [1, 2, 3] appears as ((mlist) 1 2 3) in Lisp.
Calling from Lisp to Maxima is a little harder. Functions defined
in Maxima are not usually ordinary Lisp functions. You can call
Maxima functions via mfuncall or mapply1. To evaluate an
arbitrary Maxima expression, (meval my-expr).
I think you found the stuff about "Lisp and Maxima" in the reference
manual already.
See also the stuff about translation and compilation in the reference manual.
There is some stuff about Lisp & Maxima in the document "Minimal Maxima".
http://maxima.sourceforge.net/docs.shtml
This newsgroup post describes how to load & save a modified Maxima image.
http://groups.google.com/group/comp.lang.lisp/msg/a440a4d6341ff8de
If you tell us more about what you are trying to accomplish,
maybe we can give some more specific advice.
best
Robert Dodier