User defined functions



Am 24 Nov 2005 um 13:16 hat Robert Jerrard geschrieben:

> When I create a function definition that I would like to make available
> to all users on a machine, where should I put the definition? I have
> read something about a maxima-init.mac file but is this the right file
> to create and what directory it should reside in? Will that file
> disappear in an upgrade?
> 
> Thanks, Bob

Hello Bob,

create the file maxima-init.mac and copy it to 
...\Maxima-5.9.x\share\maxima\5.9.x\share
A file named maxima-init.lisp is already there.

maxima-init.mac is read by Maxima at every start and restart.
Put in there any maxima code you want.
Maybe you want to set global variables like 
inchar, outchar,linechar, stardisp, ...

Add the lines 
file_search_maxima: 
   append(["C:\\home\\maxima\\###.{mac,mc}"], file_search_maxima)$
and/or
file_search_lisp: 
   append(["C:\\home\\Lisp\\###.{lisp}"], file_search_lisp)$
into maxima-init.mac.
Then you can put any Maxima resp. Lisp code file into folder C:\\home\\maxima 
and this file will be loaded by the command 
load("myfile")$

Or just say load("C:\\home\\maxima\\myfile.mc")$ without setting file_search_maxima.

If you grade up, you just have to save your maxima-init.mac.

Hope that helps

Volker van Nek