# [Maxima] evaluation

John Lapeyre pdl at johnlapeyre.com
Sat Oct 11 23:20:12 CDT 2008

```1) A question: what does (meval* expr) correspond to in
maxima?

2) I tried Robert's suggestion of using a macro function
(::=) (that looks like a frightening emoticon) I made
progress this wasy with the list-making Table function, but
it fixed some examples and broke some others.

Its probably possible to implement it in maxima, but I
switched to lisp. The good news is I was quickly able to get
Table to reproduce more Mma examples than I had hoped for,
even those that I was putting off for later; that is, those
in the test file that I had commented out.

2a) The lisp Table implementation is the same speed when
compiled as create_list.  It is interesting that makelist is
about 10 times slower. makelist should probably be rewritten
(unless there is some functionality I don't know about).  I
originally used (cons newelement allelements) and then
(reverse allelements), then I switched to loop with the
collect keyword, but I didn't see a difference in speed.
The Table code is much bigger than create_list and makelist,
but it has much more functionality.

2b) Table is really a different animal than create_list, maybe
complementary: create_list uses multiple iterators to build
a serial list, while Table uses them to build a nested list
of arbitrary depth. It is heavily used in Mma code.  At some
point, it might be useful to include it in the Maxima
distribution, either as it is or modified. But I can't see a
natural way to merge it with an existing function.

If you wanted to, you could get Table to behave like
create_list as well, that is, allow both serial and nested
multiple iterators in the same call. Mathematica hasn't
implemented this, but I don't see why it wouldn't work. ie

table(f(i,j,k), [i,0,10,1,j,1,20,2],[k,1,10,1])

Here i and j would loop at the outer level of the returned
list (but the j loop would be inside the i loop), and k at
the inner level.  I don't know if this is useful.

3) Regarding generalized transpose : it seems every system has
a function for it: Mathematica, R, octave/matlab, fortran
90, etc. I thought of copying one of those, but instead I
will do a completely naive implementation in lisp and worry
about efficiency later. Given that it seems so generally
useful, it might be good to include it in Maxima somewhere
as well.

John

```