Maxima values scheme



On 2/20/07, Barton Willis <willisb at unk.edu> wrote:

> I could make linsolve_by_lu *always* return a two member list
> [sol, cnd].

I think that is the right thing to do.

> But lu_factor doesn't compute a condition number
> when it uses exact numbers. In this case, I think it would be
> ok for cnd to be 0.

I'll recommend a nonnumeric value here. How about false.

> I don't like making a new global, say lu_condition, that gets
> assigned to the latest condition number.

Agreed -- returning information via globals is a mess.

> As you suggest if [p] : [1,2] would just assign p and trash the
> 2 might be ok too.

Yeah -- the CL multiple-value stuff works like that, doesn't it?
Not that we are obligated in any way, shape, or form to follow CL.

With the CL multiple-value stuff, the caller can safely pretend that a
multiple-value function has returned only one value.
If in Maxima multiple values were represented as ordinary lists,
that couldn't work the same. Maybe multiple values need to be
represented by something other than a list, e.g. values(a, b, c).
Just a thought.

Robert