Bug fix: bogus behavior after translating a redefined translated fun
When a function $FOO is defined with DEFMFUN, an internal function
FOO-IMPL and a compiler macro are also defined. The compiler macro
allows for calling FOO-IMPL directly instead of going through $FOO.
When translating a function, it may or may not get defined using
DEFMFUN. When it is defined with DEFMFUN, the compiler macro and
internal function have not been removed when removing various transl
properties and definitions, like when killing or redefining it.
This has caused a problem when (for example) a function was translated
and gets defined with DEFMFUN, then a new function with the same name
was translated and defined without using DEFMFUN. In this case the old
compiler macro and internal function would be left over, so if a lisp
implementation decided to use the compiler macro for a lisp call to the
new function then we could get confusing and bogus behavior.
Here's an example using SBCL:
(%i1) foo () := 0$
(%i2) translate (foo)$ /* defines compiler macro, etc. */
(%i3) kill (foo)$ /* doesn't remove compiler macro, etc. */
(%i4) foo ([l]) := l$ /* also doesn't remove compiler macro, etc. */
(%i5) translate (foo)$ /* doesn't overwrite compiler macro, etc. */
(%i6) test1 () := foo ()$
(%i7) compile (test1)$
(%i8) test1 (); /* gives the wrong result (should be []) */
(%o8) 0
(%i9) test2 () := foo (1, 2, 3)$
(%i10) compile (test2)$
<snip sbcl warning>
(%i11) test2 (); /* even worse */
<lisp error>
Now we remove the compiler macro and internal function when removing
other translator properties and definitions.
No problems with the test suite or share test suite.
tests/rtest_translator.mac runs as expected, with a new test.