errors in tests



As I say, the primary goal should be readability.  That is the main reason I
prefer memq to (member ... :test #'eq).

Performance does, however, also matter.  Mostly in getting the algorithms
right, then in avoiding redundant work, and finally in careful low-level
coding.  The original Macsyma code was fanatical about the low-level coding
since it was running on machines that were so much smaller and slower than
today's, often at the expense of readability, though we still benefit from
that extra performance in some applications.  As for avoiding redundant
work, since you can't tell Lisp that two calls to ratsimp on the same
arguments and the same environment will produce the same result, you should
probably save the result.

The optimizations of memq should be part of the standard Lisp compilers;
that is, (member 'a ...) (with no :test flag) should realize that 'a is a
symbol and therefore an eq test suffices; (member ... '(a b)) similarly.
And that member/eq of a length 1 or 2 list should be expanded inline.
Maxima shouldn't have to concern itself with this.  But then, in looking at
some of the code produced by GCL at least, I see that it doesn't optimize
much of anything, presumably depending on the C compiler for that -- though
the C compiler doesn't know Lisp semantics, and therefore can only perform
low-level optimizations.  I don't know if other compilers do better.

             -s