Bug fix: Problems with unapply
The function unapply , which constructs a procedure from an expression, has two major shortcomings, listed below. To correct them, I have written the alternative procedure vnapply .
> f:=unapply(vector([1,x,x^2]), x);
> f(t);
> F:= unapply(Vector([1,x,x^2]), x);
> F(t);
Here it is with vnapply :
> f:= vnapply(vector([1,x,x^2]), x);
> f(t);
> F:= vnapply(Vector([1,x,x^2]),x);
> F(t);
>
unapply(diff(g(x),x), x);
unapply(diff(g(x,y),y),y);
Unfortunately, unapply fails to do this in slightly more complicated circumstances.
>
unapply(2*diff(g(x),x), x);
unapply(diff(g(x,y),x)+diff(g(x,y),y),(x,y));
Here they are with vnapply :
>
vnapply(2*diff(g(x),x), x);
vnapply(diff(g(x,y),x)+diff(g(x,y),y),(x,y));
See also: array , D , diff , evalhf , table , unapply , vnapply
Maple Advisor Database, R. Israel 2000