Maxima storage class semantics



On Thu, Jan 25, 2007 at 06:15:46PM +0000, miguel Lopez wrote:
> Jay Belanger <belanger <at> truman.edu> writes:
> 
> 
> > >   The say:  Please eliminate thoses ideas that no one can foresee.
> > 
> > What ideas are those?
> 
> 
>   My point is this one:
> 
>    Suppose I'm a student and i am begining with vector calculus,
>    I should expect that divergence was define as:
> 
>    divergence(f):=[diff(f,x),diff(f,y),diff(f,z)];
> 
>    and grad, curl, etc in similar terms.
> 
>    I think this can be done in 30 minutes or less, but the current package
>    is complicated (in my opinion).
> 
>    Read the recents  questions about rk to see the problems with list and matrices.

I agree to some extent here... Maxima has confusing semantics with
regard to lists, matrices, arrays, subscripted variables, and soforth.

Perhaps a generalized discussion of what the semantics of the various
storage classes SHOULD be is in order, then we could discuss whether
or not changing to those semantics is a major problem for existing
code...

To kick it off, I think maxima should have (at least) the following
types of things:

1) lists, which are just like lisp lists, current maxima lists are fine

2) vectors, which have mathematical semantics and O(1) indexing. 

3) Arrays, which are like common lisp "vectors"

4) Hash tables, which are like common lisp hash tables but can be
accessed in a similar way to an array, except the index need not be an
integer.

5) Numerical arrays, which are like common lisp arrays specialized to
double floats.

6) Matrices, which should have mathematical semantics.

When assigning any of these to a named variable, they should be
assigned to the "value" cell of that variable.

It seems to me that currently there is some confusion over whether a
list is a vector, or how many ways to use an array... etc.

-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan