>>>>> "Richard" == Richard Fateman <fateman@cs.berkeley.edu> writes:
Richard> This code is executed so many times that it is certainly
Richard> a bad idea to check unnecessarily. See below...
Good point.
Richard> How about
Richard> (defmfun simplifya (x y)
Richard> (cond ((atom x)
Richard> (cond ($numer
Richard> (cond ((eq x '$%pi) %pi-val)
Richard> (( eq x '$%e) %e-val)
Richard> (t x)))
Richard> ....
I like this.
Richard> or even
Richard> ... (cond ($numer
Richard> (cond ((numberp x) ... do something here perhaps,
Richard> like 3 ->3.0d0
Shouldn't 3 remain 3 instead of being converted to a double-float?
Richard> ;; treat all symbols here, like %pi, %e,
Richard> %euler, %avogadro....
Yes, this is a good idea.
Richard> (t (or (get x 'numval) x) ;; need to set up
Richard> such values. Or use slower MGET?
I think this is also a nice idea. However, I think I'll wait for the
next release before thinking about implementing this.
Ray