Subject: Customizing Maxima. Renaming Maxima functions
From: Richard Hennessy
Date: Thu, 25 Sep 2008 12:41:41 -0400
Thanks,
I think this actually is what I want. I have just one more question, I hope. How can you define in Maxima a function
called let's say
foo(e, x)
and also have it work for three arguments
foo(e, x, a, b)
?
In languages that I know better than Lisp this is called function overloading. I don't know what it is called in
Maxima. Integrate is an example of this type of function in Maxima, since you can say
integrate(expr,x,a,b)
or
integrate(expr,x)
and not get an error message.
Thanks,
Rich
----- Original Message -----
From: "Richard Fateman" <fateman at cs.berkeley.edu>
To: "'Richard Hennessy'" <rvh2007 at comcast.net>; "'Maxima List'" <maxima at math.utexas.edu>
Sent: Wednesday, September 24, 2008 8:24 PM
Subject: RE: [Maxima] Customizing Maxima. Renaming Maxima functions
try
:lisp (setf (symbol-function '$rsum)(symbol-function '$integrate))
:lisp (unintern '$integrate)
While this accomplishes what you asked for, it is unlikely that this
makes sense for you to do.
Oh, you can restore the name by ..
:lisp (setf (symbol-function '$integrate) (symbol-function '$rsum))
This will not work for items in Maxima that are more than functions.
For example, $cos has various property that would have to be moved if
you renamed it $cosinus.
There is also a command called alias( ..)
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Richard Hennessy
> Sent: Wednesday, September 24, 2008 5:08 PM
> To: Maxima List
> Subject: Customizing Maxima. Renaming Maxima functions
>
> Dear List,
>
> I would like to rename some Maxima commands somehow. By
> rename I literally mean rename, the old name won't work anymore
> after it is done. e.g. I would like to change "integrate"
> to "rsum" for example. So rsum(x^2,x) will return 1/3*x^3
> and rsum(x^2,x,0,1) will return 1/3 and also all error
> messages would be the same as if rsum were integrate. Can
> someone help me? Also undoing this would be good to know too
> so I can change the name in a block and then change it
> back at the end of the block for example.
>
> Thanks,
>
> Rich
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima