Question: Passing variable number of arguments

I'm starting to use procs a lot just because they are more general and can more easily handle complex functionality.

 

I usually have to pass a function to them and that function may or may not take a series of arguments.

 

e.g.,

 

f := (x,y,a)->a*x*y;

g := proc(q, ...)

    q(x,y,...)

end proc;

 

g(f, 3);

 

Here 3 should be passed for a(using ... to represent it).

 

If I pass a function

 

h := (x,y)->x*y

then it would be g(f)

 

I could possibly use nops, ops, arrays, etc... but looking for the right solution.

 

Please Wait...