evalapply - Maple Help

evalapply

user definable control over function application

 Calling Sequence evalapply/V(f, t))

Parameters

 f - function call t - list of arguments

Description

 • When nontrivial Maple objects such as unevaluated function calls, lists, or sets are applied to arguments as if they were functions, the evalapply command determines the outcome. For example, an object of type function can be applied to arguments, as in V(f, g)(a, b, c).
 • The effect of applying the result of most built-in constructors to a sequence of arguments is determined by an internal evalapply function. The evalapply command also implements the application semantics for compositions and compositional powers.
 • The effect of applying a function call to arguments can be specified by defining an optional procedure of the name evalapply/V, where V is the name of the function.
 • When present, the procedure of the name evalapply/V is automatically invoked with f set to V(f, g), and t set to [a, b, c] in response to the function invocation V(f, g)(a, b, c).

Examples

 > $V\left(f,g\right)\left(a,b,c\right)$
 ${V}{}\left({f}{,}{g}\right){}\left({a}{,}{b}{,}{c}\right)$ (1)
 > evalapply/V := proc(f,t) local i;   V(seq(op(i,f)(op(t)),i=1..nops(f))); end proc:
 > $V\left(f,g\right)\left(a,b,c\right)$
 ${V}{}\left({f}{}\left({a}{,}{b}{,}{c}\right){,}{g}{}\left({a}{,}{b}{,}{c}\right)\right)$ (2)
 > $\left[a,b\right]\left(x,y\right)$
 $\left[{a}{}\left({x}{,}{y}\right){,}{b}{}\left({x}{,}{y}\right)\right]$ (3)
 > $\left\{a,b\right\}\left(x,y\right)$
 $\left\{{a}{}\left({x}{,}{y}\right){,}{b}{}\left({x}{,}{y}\right)\right\}$ (4)
 > $\left(a=b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){=}{b}{}\left({x}{,}{y}\right)$ (5)
 > $\left(a+b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){+}{b}{}\left({x}{,}{y}\right)$ (6)
 > $\left(a-b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){-}{b}{}\left({x}{,}{y}\right)$ (7)
 > $\left(ab\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){}{b}{}\left({x}{,}{y}\right)$ (8)
 > $\left(\frac{a}{b}\right)\left(x,y\right)$
 $\frac{{a}{}\left({x}{,}{y}\right)}{{b}{}\left({x}{,}{y}\right)}$ (9)
 > $\left({a}^{b}\right)\left(x,y\right)$
 ${{a}{}\left({x}{,}{y}\right)}^{{b}{}\left({x}{,}{y}\right)}$ (10)
 > $\left(a·b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){·}{b}{}\left({x}{,}{y}\right)$ (11)
 > $\left(a,b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){,}{b}{}\left({x}{,}{y}\right)$ (12)
 > $\left(a..b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){..}{b}{}\left({x}{,}{y}\right)$ (13)
 > $\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{and}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{b}{}\left({x}{,}{y}\right)$ (14)
 > $\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{or}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{b}{}\left({x}{,}{y}\right)$ (15)
 > $\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{xor}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{xor}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{b}{}\left({x}{,}{y}\right)$ (16)
 > $\left(a⇒b\right)\left(x,y\right)$
 ${a}{}\left({x}{,}{y}\right){⇒}{b}{}\left({x}{,}{y}\right)$ (17)
 > $\left(\mathbf{not}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a\right)\left(x,y\right)$
 ${\mathbf{not}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{a}{}\left({x}{,}{y}\right)$ (18)
 > $\left(a@b\right)\left(x,y\right)$
 ${a}{}\left({b}{}\left({x}{,}{y}\right)\right)$ (19)
 > ${a}^{\left(n\right)}\left(a\left(x,y\right)\right)$
 ${{a}}^{\left({n}{+}{1}\right)}{}\left({x}{,}{y}\right)$ (20)
 > $\mathrm{combinat}\left['\mathrm{choose}'\right]\left(4,3\right)$
 $\left[\left[{1}{,}{2}{,}{3}\right]{,}\left[{1}{,}{2}{,}{4}\right]{,}\left[{1}{,}{3}{,}{4}\right]{,}\left[{2}{,}{3}{,}{4}\right]\right]$ (21)
 > $\mathrm{map}\left(\left\{\mathrm{op}\right\},\mathrm{combinat}\left['\mathrm{choose}'\right]\left(4,3\right)\right)$
 $\left[\left\{{1}{,}{2}{,}{3}\right\}{,}\left\{{1}{,}{2}{,}{4}\right\}{,}\left\{{1}{,}{3}{,}{4}\right\}{,}\left\{{2}{,}{3}{,}{4}\right\}\right]$ (22)