Here is a new version of the compatibility functions, along
with an Mma to Maxima translator:
http://www.johnlapeyre.com/mmacompat/index.html
(It is currently not very Windows friendly, but that can be
fixed)
There is a link there to the output of the entire current
test suite of the translator, where you can see a subset of
what has been implemented up to now.
I still don't have access to Mma, which is really starting
to be a hindrance (but I will get it sooner or later). If
anyone does play with it and has any feed back (about
failures,etc) I'd be happy to have it. Eg legal Mma syntax
that this fails to parse. I am thinking mostly about basic
stuff that is implemented, like brackets and braces, but
anything else is OK too. But sending simple Mma code that
fails, and so forth would be nice.
Most of it is syntax translation.
I only started one semi-complicated function translation,
the Mma For function to Maxima for statement. It handles
several common cases already. It looks like this will be a quite
do-able approach to several functions. (eg some of Table's
functions could be recoded into create_list, which is more
efficient).
Thanks!
John
-------------------------------------
Here is an example of the test results:
======== Test *Griffiths QI code* 1 ============
== Mma code:
bin2ket[ls_]:= Module[{ket,ln=Length[ls],m},
ket=Table[0,{2^ln}];
m=1+Fold[2*#1+#2&,0,ls];
++ket[[m]]; ket]
== Expected Maxima translation:
bin2ket(ls) := block([ket, ln : Length(ls), m], ket : Table(0, [2 ^ ln]),
m : 1 + Fold(lambda([arg2,arg1],2 * arg1 + arg2), 0, ls),
((ket[m]):(ket[m])+1),
ket)
== Parse Test 2 succeeded
== Translation Test 2 succeeded
== Maxima Interpretation Test 2 succeeded
== Maxima Regression Test Results: 2
********************** Problem 1 ***************
Input:
bin2ket([0,1,1,0])
Result:
[0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0]
... Which was correct.
1/1 tests passed.
(%o5) []
==================================
Test *Griffiths QI code* results
(2/2) parses succeeded.
(2/2) translations succeeded.
(2/2) interprets succeeded.
(1/1) passed in Maxima regression for Test 2