title: How to pass an array as an argument to a maxima function?
body: <p>I'm working on creating maxima functions to simplify the del operator on vectors. How can I pass a list/vector to a function in maxima? This works:</p>
  
  <pre><code>(%i7) dot(a,b) := a[1]*b[1]+a[2]*b[2]+a[3]*b[3];
  (%o7)                 dot(a, b) := a  b  + a  b  + a  b
                                      1  1    2  2    3  3
  (%i8) dot(a,b);
                                              2
  (%o8)                            3 x y - 4 x
  </code></pre>
  
  <p>but this doesn't:</p>
  
  <pre><code>(%i13) grad(a) := diff(a[1],x) + diff(a[2],y) + diff(a[3],z);
  define: argument cannot be an atom or a subscripted memoizing function; found: 
                                                                                a
   -- an error. To debug this try: debugmode(true);
  </code></pre>