Function: vnapply - Make a function from an expression and arguments (replacement for unapply)

Calling Sequence:

vnapply(expr, vars);


expr - any expression

vars - one or more variables (may be any non-constant expressions)



> f1:= unapply(diff(g(x,y),x,y),x,y);
f2:= vnapply(diff(g(x,y),x,y),x,y);

f1 := proc (x, y) options operator, arrow; diff(dif...

f2 := D[1,2](g)

> f1(3,4); f2(3,4);

Error, (in f1) wrong number (or type) of parameters in function diff


> V:= vector([x,x^2]): f1:= unapply(V,x);
f2:= vnapply(V,x);

f1 := proc (x) options operator, arrow; V end proc

f2 := proc (x) options operator, arrow; array(1 .. ...

> f1(u),f2(u);

V, vector([u, u^2])

> V:= Matrix([[a,b],[a+1,c]]); f1:= unapply(V,(a,b));
f2:= vnapply(V,(a,b));

V := _rtable[20480776]

f2 := proc (a, b) options operator, arrow; Matrix([...
f2 := proc (a, b) options operator, arrow; Matrix([...

> f1(q,r), f2(q,r);

_rtable[20480776], _rtable[8023904]

> unapply(x+g(z),g(z));

Error, (in unapply) variables must be unique and of type name

> vnapply(x+g(z),g(z));

proc (y) options operator, arrow; x+y end proc

See also: Problems with unapply , subs , unapply

Maple Advisor Database R. Israel, 1998