2 question about arrays



> (C1) test:make_array('fixnum,3,2)$
> (C4) arrays;

> the array named test ist declared. so why is it not listed in the list of arrays?

I'm afraid Maxima's system of arrays is rather messy.  There are three
kinds of arrays: named Maxima arrays, anonymous Lisp arrays, and
lists/matrices used as 1/2-dimensional arrays.

The array function creates a named array and adds it to the 'arrays' list.

The make_array function creates an *anonymous* array, which is not
added to the 'arrays' list.  In your example above, you have not named
the array, you have assigned an array value to a variable.

Finally, you can use lists as 1-dimensional arrays and matrices as
2-dimensional arrays:
   ar1: [2,3,4]$
   ar1[2] => 3
   ar2: matrix([2,3],[4,5])$
   ar2[2,2] => 5

Personally, I prefer the list/matrix solution because they are
first-class objects in the Maxima world, though they are slower -- but
that doesn't matter for many applications.

> foo works when not compiled, but not when compiled. can someone explain?

I'm not sure, but the compiler probably assumes that array is a named array.

           -s