Some things related to the rewritten makelist.
1) One could add some Mma-like extensions to
other functions:
eg, sum, product could optionally take lists describing the iteration.
In fact, I need this, and will write it soon if someone else does
not do it first. I would write it as Mma's Sum and Product in lisp, but
they could be modified slightly to replace sum and product.
apply,flatten, etc. can take arguments to specify the level at which they
should be applied. Mma is sort of consistent (not perfectly) in how
it does this.
2) A related change to sum is the following. I was trying to implement a minimal Mma Sum as
Sum(expr,it) := sum(expr,it[1],0,it[2]),
which would be called like:
Sum(i^2,[i,10])
But this does not work, because it[1] is never evaluated. This makes
sense, because "x:2 ; sum(x^2,x,1,3)" would fail when x evaluates to 2.
I added a couple of lines to sum (in asum.lisp) that evaluate the iteration
variable only if (symbolp itvar) fails. This, then allows the above
definition of Sum. I believe there are some other Maxima functions that
could use a similar modification. But the code for sum is a bit complicated
and this might break something.
3) I have written Transpose in lisp, which could extend
Maxima transpose, except it works on nested lists, not on
Maxima matrices. (actually, I will later have it convert
input matrix to list and then return the same type as the
input) It works like this: Transpose(m) is an ordinary matrix
transpose. Transpose(m,[i_1,i_2,...]) permutes the levels
so that level i_1 becomes level 1, etc. It could be made
more efficient, but it works. I can supply the code now if
someone wants it, but I make it available soon anyway.
4) I also need to write Array, which works something like this:
Array(f,[n,m,...]) creates a nested list of dimensions n by m by ...
whose i,j,... th element is f(i,j,...) The name is somewhat confusing
because it returns a nested list, not an array. Is there already some
easy way to do this with Maxima? I think not.
Regards,
John