This code is executed so many times that it is certainly
a bad idea to check unnecessarily. See below...
Raymond Toy wrote:
>>>>>>"willisb" == willisb <willisb@unk.edu> writes:
>>>>>>
>
> willisb> Stavros Macrakis (bug 609464) reported that
>
> willisb> (C2) %e ^ %e, numer;
> willisb> (D2) %E^%E
>
> He also reports 1+%e,numer returns unevaluated. I think the fix for
> this is changing the first few lines of simplifya to
>
> (DEFMFUN SIMPLIFYA (X Y)
> (COND ((ATOM X)
> (COND ((AND (EQ X '$%PI) $NUMER)
> %PI-VAL)
> ((and (eq x '$%e) $numer)
> %e-val)
> (T X)))
>
> Touching simplifya is pretty scary, but I think this is a pretty safe
> change to make, especially given the code for %pi. :-)
>
>\
How about
(defmfun simplifya (x y)
(cond ((atom x)
(cond ($numer
(cond ((eq x '$%pi) %pi-val)
(( eq x '$%e) %e-val)
(t x)))
....
or even
... (cond ($numer
(cond ((numberp x) ... do something here perhaps, like
3 ->3.0d0
;; treat all symbols here, like %pi, %e, %euler,
%avogadro....
(t (or (get x 'numval) x) ;; need to set up such
values. Or use slower MGET?
;;; this line above would be slower than (eq
x '$%pi) but would not be checked
;;; unless numer was true.
...