[Maxima] use_fast_arrays : true & batch files

Barton Willis willisb at unk.edu
Wed Jul 11 06:54:07 CDT 2012


Maxima appends line number and file name information to the car of an expression when batching a file--stuff like

    ((MPLUS SIMP  (53 "C:/Users/Barton/Desktop/junk/rtest_aref.mac"  SRC))  $X ((MTIMES SIMP) -1 $Y))

Since undeclared arrays use CL hash tables with an equal test (not alike1) for equality,  batch files can have problems
with undeclared arrays when use_fast_arrays is true.  (CL hash tables only support the equality tests eq, eql, equal, and equalp.
There is a source code comment in trans2.lisp that suggests changing the equality test for a hash table to alike--not going to
happen.)  Sticking to integer indices for undeclared arrays might be safe.

Maxima isn't careful about preserving extra junk in the car of an expression, by the way.

I suppose this could be fixed by scrubbing the line and file information from the car of an expression before it is stored or accessed
from a CL hash table---ugh. A missing simp flag could cause problems too.  When use_fast_arrays is false, I think this problem disappears.

--Barton

A regression test file that shows the problem (at least it does for me):

(use_fast_arrays : true,0);
0$

(a[%pi] : 42, 0);
0$

a[%pi];
42$

(remarray(a),0);
0$

(ab[x-y] : s, 0);
0$

ab[x-y];
s$




More information about the Maxima mailing list