how to print algebraic expressions as an S-expression which is valid CL code



On Sat, 11 Apr 2009 11:15:42 -0500, Barton Willis wrote:

> (%i22) load("tocl")$
> 
> (%i23) to_cl(%o6);
> 
> (/ (+ (* (+ (* CHI LF) CHI) RHO) (* (+ 1 (- CHI)) LW) (* CHI LF) 1)
>    (+ (* (+ 1 (* -1 CHI)) LF) (* (+ CHI LF) LW)
>       (* (+ CHI (* CHI LF)) RHO)))
> 
> If to_cl doesn't do exactly what you want, it's fairly easy to modify
> the to_cl translator, I think.

Thank you so much!  Following Richard Fateman's suggestion, I was
halfway writing my own version of this, and I was
struggling with fractions when your message arrived - I really
appreciate your help, this is exactly what I needed.

Tamas