Maxima step-by-step mode



2008/11/12, Raymond Toy <raymond.toy at ericsson.com>:
>
>
>     Andrew> And the last question today.
>     Andrew> At lisp level we have expressions like this
>     Andrew> ((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X) ((MTIMES
> SIMP) 8
>     Andrew> ((MEXPT SIMP) $X 2))) 0)
>     Andrew> They are in prefix form. Does Maxima have a lisp-function to
> convert such am
>     Andrew> expression to human-readable infix form? (or infix TeX form)
>
> dipla.  Use it like this:
>
> :lisp (displa '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
> ((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0))
>
>    2
> 8 x  - 4 x - 8 = 0
>
> Be sure to that everything is on one line when typing in :lisp.  It
> doesn't like it spread over multiple lines.
>
> Hope this helps,
>
> Ray
>

Thank you for advise, displa woks ok.
I tried to find a function like displa, but gives TeX-syntax output.
I've found the "mactex.lisp" file and tried to use function "tex"

The only way I cound use it was
(%i1) :lisp (tex '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0) nil nil nil nil);
(\left( 8 \, x ^ 2 - 4 \, x - 8 = 0 \right))

Am  I using the right function?

I tried to surround the output expression with "$", but something got wrong:
(%i1) :lisp (tex '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0) ("$$") ("$$") nil nil);
Maxima encountered a Lisp error:

EVAL: "$$" is not a function name; try using a symbol instead

I think, I need to quote the $ sign, but I don't know how...
Backslashes-quoting didn't help

(%i1) :lisp (tex '((MEQUAL SIMP) ((MPLUS SIMP) -8 ((MTIMES SIMP) -4 $X)
((MTIMES SIMP) 8 ((MEXPT SIMP) $X 2))) 0) ("\$") ("\$") nil nil);
Maxima encountered a Lisp error:

EVAL: "$" is not a function name; try using a symbol instead


Andrey Yeltsin
nigma.ru