construct a function expression
expression (e.g., a procedure or name) to be applied
(optional) expression sequence of arguments to be passed to p
The apply(p, rest) calling sequence returns the expression p⁡rest.
Using unapply, the apply procedure satisfies the functional equation apply(unapply(p, v), op(v)) = p.
If p has special evaluation rules, then these rules are not respected.
apply(f, s, t, u, v);
map(apply, [sin, cos, tan], Pi);
apply( [sin, cos, tan], Pi );
apply(unapply(x^2 + y^2, [x, y]), a, b);
description "an anonymous and recursive procedure";
(x -> apply(x, x))(f -> proc(p, c)
if c > n then
(f(f))(p * c, 1 + c)
end proc)(1, 1)
end proc, [$ 1 .. 10]);
An example of special evaluation rules. The command Typesetting[Typeset] is an internal command that receives a Maple expression, and returns an expression used by the GUI for typesetting purposes. The output usually looks just like the input, but it is a very different expression:
The first argument to Typeset has type uneval, signifying that it is not evaluated before being passed to Typesetting[Typeset]. In the previous example, that means we can assign something to x (say, 5), but still get a typeset square root of x rather than of 5.
x := 5;
If we want x to evaluate to 5 before typesetting occurs, we can use the apply command.
Download Help Document
What kind of issue would you like to report? (Optional)