Translated code and simplification of %pi in presence of numer=true



Hello,

For uncounted aeons, (let (($numer t)) (simplifya '$%pi)) => 3.14...
which was due to a special case at the top of SIMPLIFYA.
(Simplifying other symbols which have numeric values didn't
yield the numeric value, only for %pi.)
Not too long ago, that special case was cut out (in r1.54 src/simp.lisp
circa March 2008). Now %pi acts like other constants.

So far, so good. However, a translation of, say, 2 * %pi yields
something like (mul* 2 '$%pi) which punts to SIMPLIFYA, so now
even if numer=true, it yields a non-numeric expression. E.g.:

foo (x) := x * %pi;
foo (2), numer; => 6.28...
translate (foo);
foo (2), numer; => 2*%pi

Looking at the translated code we see:

#<FUNCTION $FOO ($X) (DECLARE (IN-DEFUN $FOO) (SPECIAL $X))
  (BLOCK $FOO (MUL* $X '$%PI))>

I guess to make translated code equivalent to interpreted,
we could go back to the old scheme in which %pi simplifies
to 3.14... in the presence of numer=true (although we'd want
to extend it to all symbolic constants), or maybe emit different
code from the translator. Maybe (MUL* $X (MEVAL '$%PI)) ??

At this point I don't have a preference. Maybe symbolic constants
should simplify to their numeric values in the presence of numer=true.
I'm not sure. Comments?

Robert Dodier