Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.613.

`compfile (filename, f_1, ..., f_n)`

`compfile (filename, functions)`

`compfile (filename, all)`

Translates Maxima functions into Lisp and writes the translated code into the file ** filename**.

** compfile(filename, f_1, ..., f_n)** translates the specified functions.

**and**

`compfile (filename, functions)`

**translate all user-defined functions.**

`compfile (filename, all)`

The Lisp translations are not evaluated, nor is the output file processed by the Lisp compiler. ** translate** creates and evaluates Lisp translations.

**translates Maxima into Lisp, and then executes the Lisp compiler.**

`compile_file`

See also ** translate**,

**, and**

`translate_file`

**.**

`compile_file`

`compile (f_1, ..., f_n)`

`compile (functions)`

`compile (all)`

Translates Maxima functions ** f_1, ..., f_n** into Lisp, evaluates the Lisp translations, and calls the Lisp function

**on each translated function.**

`COMPILE`

**returns a list of the names of the compiled functions.**

`compile`

** compile (all)** or

**compiles all user-defined functions.**

`compile (functions)`

** compile** quotes its arguments; the quote-quote operator

**defeats quotation.**

`''`

Compiling a function to native code can mean a big increase in speed and might cause the memory footprint to reduce drastically. Code tends to be especially effective when the flexibility it needs to provide is limited. If compilation doesn’t provide the speed that is needed a few ways to limit the code’s functionality are the following:

- If the function accesses global variables the complexity of the function can be drastically be reduced by limiting these variables to one data type, for example using
or a statement like the following one:`mode_declare`

`put(x_1, bigfloat, numerical_type)`

- The compiler might warn about undeclared variables if text could either be a named option to a command or (if they are assigned a value to) the name of a variable. Prepending the option with a single quote
tells the compiler that the text is meant as an option.`'`

`define (f(x_1, ..., x_n), expr)`

`define (f[x_1, .--, x_n], expr)`

`define (f[x_1, ..., x_n] (y_1, ..., y_m ), expr)`

`define (funmake (f, [x_1, ..., x_n], expr)`

`define (arraymake (f, [x_1, ..., x_n], expr)`

`define (ev (expr_1), expr_2)`

Defines a function named ** f** with arguments

**and function body**

`x_1, ..., x_n`

**.**

`expr`

** define** always evaluates its second argument (unless explicitly quoted). The function so defined may be an ordinary Maxima function (with arguments enclosed in parentheses) or an array function (with arguments enclosed in square brackets).

When the last or only function argument ** x_n** is a list of one element, the function defined by

**accepts a variable number of arguments. Actual arguments are assigned one-to-one to formal arguments**

`define`

**, and any further actual arguments, if present, are assigned to**

`x_1, ..., x_(n - 1)`

**as a list.**

`x_n`

When the first argument of ** define** is an expression of the form

**or**

`f(x_1, ..., x_n)`

**, the function arguments are evaluated but**

`f[x_1, ..., x_n]`

**is not evaluated, even if there is already a function or variable by that name.**

`f`

When the first argument is an expression with operator ** funmake**,

**, or**

`arraymake`

**, the first argument is evaluated; this allows for the function name to be computed, as well as the body.**

`ev`

All function definitions appear in the same namespace; defining a function ** f** within another function

**does not automatically limit the scope of**

`g`

**to**

`f`

**. However,**

`g`

**makes the definition of function**

`local(f)`

**effective only within the**

`f`

**or other compound expression in which**

`block`

**appears.**

`local`

If some formal argument ** x_k** is a quoted symbol (after evaluation), the function defined by

**does not evaluate the corresponding actual argument. Otherwise all actual arguments are evaluated.**

`define`

See also ** :=** and

**.**

`::=`

** define** always evaluates its second argument (unless explicitly quoted).

`(%i1) `**expr : cos(y) - sin(x);**
(%o1) cos(y) - sin(x)
(%i2) **define (F1 (x, y), expr);**
(%o2) F1(x, y) := cos(y) - sin(x)
(%i3) **F1 (a, b);**
(%o3) cos(b) - sin(a)
(%i4) **F2 (x, y) := expr;**
(%o4) F2(x, y) := expr
(%i5) **F2 (a, b);**
(%o5) cos(y) - sin(x)

The function defined by ** define** may be an ordinary Maxima function or an array function.

`(%i6) `**define (G1 (x, y), x.y - y.x);**
(%o6) G1(x, y) := x . y - y . x
(%i7) **define (G2 [x, y], x.y - y.x);**
(%o7) G2 := x . y - y . x
x, y

When the last or only function argument ** x_n** is a list of one element, the function defined by

**accepts a variable number of arguments.**

`define`

`(%i8) `**define (H ([L]), '(apply ("+", L)));**
(%o8) H([L]) := apply("+", L)
(%i9) **H (a, b, c);**
(%o9) c + b + a

When the first argument is an expression with operator ** funmake**,

**, or**

`arraymake`

**, the first argument is evaluated.**

`ev`

`(%i10) `**[F : I, u : x];**
(%o10) [I, x]
(%i11) **funmake (F, [u]);**
(%o11) I(x)
(%i12) **define (funmake (F, [u]), cos(u) + 1);**
(%o12) I(x) := cos(x) + 1
(%i13) **define (arraymake (F, [u]), cos(u) + 1);**
(%o13) I := cos(x) + 1
x
(%i14) **define (foo (x, y), bar (y, x));**
(%o14) foo(x, y) := bar(y, x)
(%i15) **define (ev (foo (x, y)), sin(x) - cos(y));**
(%o15) bar(y, x) := sin(x) - cos(y)

⭕