Lists and arrays with the same name



Dear list,

I'm quite confused about the way Maxima handles variables. I have an
issue concerning arrays and lists.
Here is a quick example.

I created an undeclared array, b:

b[1] : 1;
b[5] :2;

c : listarray(b);
b : listarray(b);

While c is a pure list, b is both a list and an undeclared array. But
it seems there are inconsistencies. In fact:

listp(b) returns true, and b is listed in the array list (arrays
command), and also informations can be rerieved with arrayinfo(b). But
Maxima, sometimes treats it as a list, other times as an array.

1 - list-cases:

listarray(b) says b is not an array
part(b,i) with i integer


2 - array-cases

b[i], with b integer

Sometimes in my codes I use to convert arrays to lists re-assigning
the same name, but it causes me some troubles. Most problems come out
because when b is a list it has continuous subscript indices, while as
an undeclared array this is not necessary true.

I remember there was some time ago an analogous discussion on this
mailing list, but I cannot find it. I would be grateful if someone
could explain me this behaviour.

Thank you.
Stefano