Sr. Schneider
Sr. Schneider

Reputation: 757

Maxima: How to define built-in functions?

Is there a way to define built-in functions in Maxima?

I have a function which I would like to use in several .wxm files without defining them in every file.

Upvotes: 1

Views: 403

Answers (1)

Robert Dodier
Robert Dodier

Reputation: 17576

You can put the functions in a file, let's say it is named foo.mac, and then call load("foo.mac") to load the functions into Maxima or wxMaxima.

Note that load needs to be able to find foo.mac. If foo.mac is not in one of the usual folders, you can help load find it in a few different ways:

(1) State the fully-qualified path, e.g. load("/Users/myfolder/myfunctions/foo.mac").

(2) Put your folder on the list of folders to search and then call load. E.g.

push ("/Users/myfolder/myfunctions/###.mac", file_search_maxima);
load ("foo.mac");

Note that file_search_maxima is a global variable which tells all the folders in which load searches.

Upvotes: 2

Related Questions