Subject: Noun forms of elementry arithmetic functions
From: Robert Dodier
Date: Tue, 25 Oct 2005 09:41:15 -0600
Hello Chris,
> x + 1 + x,
>
> without these automatically being simplified to 2*x+1.
I believe you can get what you want by using
stuff (namely flags to control evaluation and simplification)
that's already built-in.
You can make nouns of built-in operators. Write the operator
name in double quotes.
foo: ' "+" ( ' "*" (2, 3), 5) => mplus(mtimes(2, 3), 5)
ev (foo, "+") => mtimes(2, 3) + 5
ev (foo, "*") => mplus(6, 5)
ev (foo, nouns) => 11
%MPLUS, %MTIMES, etc should probably display as
+, *, etc; that would be a mild bug in the display code.
Also simp: false$ will probably be useful to you.
I made an attempt to explain something about simplification
and evaluation. You can judge for yourself whether it's useful.
http://maxima.sourceforge.net/docs/tutorial/en/minimal-maxima.pdf
Also, ev is a many-splendored thing: see ev under "Command Line" at
http://maxima.sourceforge.net/docs/manual/en/maxima_toc.html
Hope this helps,
Robert Dodier