Question: Functional operator within a proc

Hello

It has been years since I last used maple so I apologize if my question makes no sense and my code is outdated (and wrong!).   

I need to write a function (proc) that uses a functional operator inside.  Something like

test:=proc()

local f,vars, func, aux, res;

f:=arg[1]; # a list

vars:=arg[2]: # a list

aux:=op(vars):

func:=aux -> f:  # a function from () to []

res:=func(op(func(aux))):

return(res):

end:

 

This is the basic idea of the proc.  If f:=[y, y*z-x, -15*x*y-x*z-x] and vars:=[x,y,z], the function of a function does not return as it supposes to.  Please tell me what I am doing wrong and how to improve and update the code.

 

many thanks

 

Ed

 

 

 

Please Wait...