Formatting Fortran output of Maxima expressions wrt placement characters



On 6/9/09, Vishal Ramnath <VRamnath at nmisa.org> wrote:

> Is there an easy way to automatically get rid of these placement characters
> before the fortran expression in Maxima is saved so that the expression can
> be used natively in Fortran without too many hassles?

Do you mean the line continuation characters? A Fortran compiler
should use those to join lines together.

Maybe I'm not understanding what the problem is. Can you show an
example which has the extraneous output?

If you want to import an expression into Octave instead of Fortran,
Octave's line continuation character is a trailing backslash.
Couple of options here: (1) Modify share/contrib/f90.lisp to output
backslash instead of ampersand for line continuation.
(2) Again using f90.lisp, set the global variable
*F90-OUTPUT-LINE-LENGTH-MAX* to some very large number
to avoid breaking lines. In a Maxima session,
:lisp (setq foo 12345678)
or whatever, assigns the value to the global variable FOO.

Octave output seems like it would be generally useful, so maybe
we should just have a function to do that.

> Alternatively is there a simple way to make a callable executable function
> like a dll for a Maxima code snippet that another program can access and use
> by just providing the values for the input arguments.

Lisp systems are generally capable of that, but the details differ
from one implementation to another. Probably at this point it's
easier to just export the expressions in a plain text file.

Hope this helps

Robert Dodier