I am a bit confused ; I noticed that if I do :
a[sqrt(2)] : 1;
arrays;
I would get :
[a]
So a is an array for Maxima… yet sqrt(2) is an irrational number.
I use to think of an array as a collection of items sorted by indices, where those indices are integer numbers… I acknowledge that my definition for "array" has been strongly influenced by other, "non-symbolic" programming languages. In those languages, arrays "map" to a certain contiguous region of a computer's memory. It is therefore natural to use integer number as indices since integer number are countable. However, real numbers are not countable.
Obviously, maxima seems to have a different definition for the term "array" : what is it exactly ? (the documentation does not define it, at least there is no introductory paragraph in the documentation section dedicated to arrays)
Maxima's concept of arrays, lists, and matrices is pretty confused, since various ideas have accreted in the many years of the project.
Maxima's "subscripted variable" = symbol with subscript (with arbitrary index) and no assigned value. E.g. a[sqrt(2)] with no value assigned.
Maxima's "undeclared array" = hash table with arbitrary keys, associated with array symbol as a symbol property, not a value. Your a[sqrt(2)] : 1 is an example of an undeclared array. Maxima creates the array a the first time a value is assigned.
Maxima's "declared array" = contiguous storage, associated with array symbol as a symbol property, not a value.
Maxima's "Lisp array" = contiguous storage, associated with array symbol as symbol value.
Maxima's "fast array" = hash table, associated with array symbol as a symbol value.
Yes, this is a mess. Sorry about that. These are all interesting ideas, but there is no unifying framework. I haven't even mentioned lists and matrices. Hope this helps all the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With