odelin SciMax Toolbox opena

SciMax Toolbox >> op

op

Maxima Function

Calling Sequence

op (expr)

Description

Returns the main operator of the expression expr. op (expr) is equivalent to part (expr, 0).

op returns a string if the main operator is a built-in or user-defined prefix, binary or n-ary infix, postfix, matchfix, or nofix operator. Otherwise, if expr is a subscripted function expression, op returns the subscripted function; in this case the return value is not an atom. Otherwise, expr is an array function or ordinary function expression, and op returns a symbol.

op observes the value of the global flag inflag.

op evaluates it argument.

See also .

Examples:

(%i1) stringdisp: true$
(%i2) op (a * b * c);
(%o2)                          "*"
(%i3) op (a * b + c);
(%o3)                          "+"
(%i4) op ('sin (a + b));
(%o4)                          sin
(%i5) op (a!);
(%o5)                          "!"
(%i6) op (-a);
(%o6)                          "-"
(%i7) op ([a, b, c]);
(%o7)                          "["
(%i8) op ('(if a > b then c else d));
(%o8)                         "if"
(%i9) op ('foo (a));
(%o9)                          foo
(%i10) prefix (foo);
(%o10)                        "foo"
(%i11) op (foo a);
(%o11)                        "foo"
(%i12) op (F [x, y] (a, b, c));
(%o12)                        F
                               x, y
(%i13) op (G [u, v, w]);
(%o13)                          G
odelin SciMax Toolbox opena