Previous: Converting Franz Lisp Programs to AKCL Up: A Programmer's Guide for AKCL and MAXIMA Next: Writing C code Directly in CL Files

Porting Your Vaxima Package to Maxima

Again, it is important to realize that your Franz package for Vaxima requires little change to fit under maxima. Many constructs are supported by macros. For example, defmfun, defmvar, and macsyma-module are still O.K. Functions such as explode, exploden, desetq, and errset, are also available. However there are a few changes to make.

  1. The first statment should be (in-package 'maxima) for any package to be compile or loaded into maxima.
  2. The global variable declaration should be converted to the form
    
    (proclaim '(special var1 var2 ...))
    
  3. Use fl2cl to translate the file, then hand convert constructs flagged by franzlisp::.
  4. Load your converted file (file.lsp) into maxima by involving maxima then

(in-package 'maxima)
(load "file.lsp")
to try it. You can run tests right at the lisp level of maxima, installing trace points etc. The trace facilities are documented in the KCL report. Or if you need, you can go into the maxima user level. This can be done best by typing (user::run). To enter lisp from the macsyma top level, type control-C to interrupt and you'll get to lisp with a MAXIMA>> break level prompt.

To re-enter macsyma top level from the break level just type


:t

After you have debugged you package, you may wish to have access to it from maxima automatically. This can best be arranged through the autoloading mechanism. The line


(autof 'function-name "pathname")
in a maxima initialization file will cause the function to be loaded into maxima when it is first called. The polyroots and the graph packages are done this way in maximarc.lsp.

farrell@mcs.kent.edu