m1pbranch SciMax Toolbox macroexpand1

SciMax Toolbox >> macroexpand

macroexpand

Maxima Function

Calling Sequence

macroexpand (expr)

Description

Returns the macro expansion of expr without evaluating it, when expr is a macro function call. Otherwise, macroexpand returns expr.

If the expansion of expr yields another macro function call, that macro function call is also expanded.

macroexpand quotes its argument. However, if the expansion of a macro function call has side effects, those side effects are executed.

See also , , and .

Examples

(%i1) g (x) ::= x / 99;
                                    x
(%o1)                      g(x) ::= --
                                    99
(%i2) h (x) ::= buildq ([x], g (x - a));
(%o2)            h(x) ::= buildq([x], g(x - a))
(%i3) a: 1234;
(%o3)                         1234
(%i4) macroexpand (h (y));
                              y - a
(%o4)                         -----
                               99
(%i5) h (y);
                            y - 1234
(%o5)                       --------
                               99
m1pbranch SciMax Toolbox macroexpand1