[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LISP prefix to infix conversion



Continuing with my project I have encountered yet another problem.  I need to
take lists in the LISP prefix notation and convert them into a more normal
english type notation.  This only has to work with math formulas.  
For Example:

    (prefix-to-infix  '(+ a (* b c)))

would return: A+(B*C)

    (+ (* (/ x (- y 3)) 5 z)

would return: x/(y+3)*5+z

Notice how the extra ()'s need to be deleted and there aren't any spaces in
the output.

If anyone can shed some light on this for me I would greatly appreciate it.
Any suggestion or actual code can be used.  Thanks.

Please reply to me via Email:    cs39msm@unccvax.uncc.edu
-Mike