Maxima CAS and programmatically defining a function with a variable number of arguments. -?

149 Views Asked by At

This is a very simplified question of what I had asked.

In Maxima, how can I include a for-loop counter in the left-hand side of an assignment, e.g.

 for i:1 thru n do(
   W[???](???):= fn(n,other stuff)
 );

such that for $n=3$ I have the (global scope) definitions,

 W[i_0](z_0):=fn1(n,...)
 W[i_0,i_1](z_0,z_1):=fn2(n,...)
 W[i_0,i_1,i_2](z_0,z_1,z_2):=fn3(n,...)

?

Note I do realize there is some Maxima machinery to handle variable numbers of arguments, but if it can be used in this application I cannot figure out how to do it...