lists, matrices, etc



On Sat, 27 Jan 2007, Dan Solomon wrote:
> How can I learn the differences/relationships between lists, arrays,
> and matrices?  I've read the documentation in pieces, and I never
> picked up the idea that if I define init[1], init[2], and init[3],
> maxima wouldn't realize that "init" meant the 3 vector.
Why have you decided that "init" means a list of 3 elements in this case 
to begin with? You never assigned any list to it.

Usual mathematical notations are very ambiguous. Sometimes a mathematician 
uses $x$, $x_1$, $x_2$, $x_3$, $x'$, $x^{\prime\prime}$ and several other 
things as independent variables which have no relation to each other. 
Sometimes $x_1$, $x_2$, $x_3$ are supposed to be components of a vector 
$x$. Maxima basically follows the first point of vies. If x is a symbol 
(nothing is assigned to it), then x can be used as a variable; x[1], x[2] 
etc. are another variables. If you want x to denote a list, the only way 
is to assign a list to it
x:[a,b,c]
After that, x will mean a list with 3 elements a, b, and c. Now x[1] means 
a. It is rather unfortunate that maxima uses the same notation x[n] for 2 
different purposes: when x is a list, x[n] selects its n-th component; 
when a is just a symbol, x[n] creates a subscripted variable. These 2 uses 
of [] have nothing in common with each other.

Hope this helps.

Andrey