Robert Dodier
-
2006-07-24
- labels: --> Lisp Core
make_array arrays are useful but ugly.
They don't print properly:
ar: make_array(any,3)$
ar[1]: sin(x)$
ar => #(NIL ((%SIN SIMP) $x) NIL)
and even worse:
string(ar) =>
?\#\(NIL\ \(\(\%SIN\ SIMP\)\ \$x\)\ NIL\)
There is no way to write a constant array, so you can't
save it in Maxima form.
It's a pity that the function name "array" is taken... but
we could define the external form of an array to be
something like:
array_constant( <<type and maybe size>>,
[ ...contents... ] )
e.g.
array_constant(any,[2,3,4])
is the same as
block([arr],arr:make_array(any,3),
for i:0 thru 2 do arr[i]:[2,3,4][i])
etc.