Problem passing arrays to linsolve( )



Hello,

I'm trying to use linsolve( ) from within a subroutine in order to code 
up a solution algorithm that is independent of the dimension of the problem.

The desire is to dynamically allocate the equation and variable arrays 
within the subroutine itself, pass these to linsolve( ) and hopefully 
get back the results.

    /* SUBROUTINE IDEA -- INCORRECT SYNTAX */
    solution(p):=(
      array(eq,p),
      array(a,p),
   
      for i:0 thru p do (
        eq[i]: sum(binom(j+1,i)*a[j],j,i,p) = binom(p,i)
      ),
   
      linsolve(eq,a)  /* THIS IS WHERE THE PROBLEM LIES */
    )$


Clearly, linsolve( ) doesn't like being passed arrays in this way.

If I manually provide the list of elements of the arrays, like below, it 
works for one particular case, which of course defeats the purpose of 
having the general subroutine.

    linsolve([eq[0],eq[1],eq[2]],[a[0],a[1],a[2]]) 
    /* UGLY: HAVE TO PASS EACH ELEMENT IN BY HAND */

Any insight would be appreciated,
Assad


-- 
____________________________________
Assad Ebrahim, M.Sc.
London, England, U.K.: +44-078.3294.8332
http://blog.mathscitech.org
assad.ebrahim at alum.swarthmore.edu

Director of Engineering
BioSonics, Inc.
Seattle, WA, U.S.A.
London, England, U.K.
http://www.biosonicsinc.com