programming in maxima



I want to write a function which computes derivative given a list.
Consider the following situation:

(%i1) array(x,10);

(%o1) x
(%i2) expr: product(1+x[i]^i,i,1,10);

(%o2) (x[1]+1)*(x[2]^2+1)*(x[3]^3+1)*(x[4]^4+1)*(x[5]^5+1)*(x[6]^6+1)
              *(x[7]^7+1)*(x[8]^8+1)*(x[9]^9+1)*(x[10]^10+1)
(%i3) l:[1,1,2];

(%o3) [1,1,2]

I want to write a function f

f(expr,l)  should compute diff(expr,x[1],1,x[2],1,x[3],2)

I can create a list as below


(%i4) create_list (x[i],i,1,length(l));

(%o4) [x[1],x[2],x[3]]
(%i5) join(%,l);

(%o5) [x[1],1,x[2],1,x[3],2]


but I am unable to solve beyond this. How can I solve the problem?


Rishi