mathematic to maxima translation



the ordinary syntax of ordinary expressions is easy. Solving these problems
does not lead to an easy solution to the tricky parts of Mathematica syntax.
Maybe all you need is the
simple part.

Tricky: the pattern matching notations, the use of operators that occur
within other operators, like =,==,===, /, //, /. , _ __ ___ and the postfix
stuff.

For example x+y/.y->3   produces 3+x.
x+3/.3->y   produces  10.+x->y

I think that your translation of ++ by doing an addition and a subtraction
doubtful.

x++ could be block([temp123:x],x:x+1,temp123).  You need to generate a name
not used by anyone else for the temp.  ?gensym()  will do it.
you may need to learn to use macros and buildq, for example:

incf(x):=buildq([temp:?gensym()],block([temp:x],x:x+1,temp));

which produces the appropriate program.  

It doesn't EXECUTE the program though.
In fact, you should consider the approach of macro expansion instead. 
That is, you should take a Mma program and translate it into a Maxima
program.
What you are doing is taking a Mma program and EXECUTING it in Maxima,
sortof.

RJF




> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of John Lapeyre
> Sent: Tuesday, September 23, 2008 12:01 AM
> To: 'Maxima Mailing List'
> Subject: mathematic to maxima translation
> 
> Here is a new version of the compatibility functions, along
> with an Mma to Maxima translator:
> 
> http://www.johnlapeyre.com/mmacompat/index.html