Maxima values scheme



>>>>> "Barton" == Barton Willis <willisb at unk.edu> writes:

    Barton> The other day I contributed a linsolve_by_lu function.  It does
    Barton> a goofy mtell on the condition number. We need something better.
    Barton> I could introduce a global mat_condition, I suppose. But what I'd
    Barton> like is a CL 'values' scheme for Maxima:

    Barton> sol : linsolve_by_lu(m,b,floatfield);  <--ok
    Barton> [sol, cnd] : linsolve_by_lu(m,b,floatfield);  <--also ok sets both sol and 
    Barton> cnd

    Barton> If anybody wants to work on this, that would be great.

Although I haven't looked at this, it seems fairly difficult to make
maxima support multiple values, at least in the Lisp sense.

But a kind of destructuring assignment seems doable.  linsolve_by_lu
would return a list and 

      sol : linsolve_by_lu(foo)

would assign the list to sol.  But we could have

     [sol] : linsolve_by_lu(foo)

just take the first element, and

     [sol, cnd] : linsolve_by_lu(foo)

would assign sol and cnd with the first and second elements of the
list.

Perhaps that would be a reasonable approach?

Ray