> SBCL will pass the test suite except where `kill(rules)' is expected
> to work correctly. It doesn't, but this is Maxima's fault, not SBCL's
> (Maxima assumes that compiled rules are built-in and therefore
> shouldn't be removed, but SBCL compiles everything, so nothing is
> removed). Note that this causes some tests to fail with `circular
> rule attempted'.
There seems to be a way to distinguish built-in rules from
user-defined ones with SBCL by means of FUNCTION-LAMBDA-EXPRESSION.
This suggests the patch below, which is quite kludgy (but so is using
COMPILED-FUNCTION-P for other implementations, so I am inclined to
apply it anyway).
An alternative would be to shadow COMPILED-FUNCTION-P (this is done
for CMUCL in commac.lisp), but I guess SBCL has already the most
sensible definition for it.
I regard the use of COMPILED-FUNCTION-P or FUNCTION-LAMBDA-EXPRESSION
as temporary solutions. IMHO, the right thing to do is to give
translated rules a non-NIL TRANSLATED property (all built-in elements
of $rules really come from trgsmp.lisp, which was more or less
translated from trgsmp.mac).
But since translation of rules is currently somewhat broken (and my
fix for it also involves changing three lines in matcom.lisp) I think
this is not quite the right moment for the right solution.
In any case, with this patch, Maxima/SBCL passes the test suite.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: suprv1.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/suprv1.lisp,v
retrieving revision 1.8
diff -C2 -r1.8 suprv1.lisp
*** suprv1.lisp 28 Jun 2002 15:05:36 -0000 1.8
--- suprv1.lisp 25 Feb 2003 19:26:51 -0000
***************
*** 476,481 ****
(symbolp x)(or (get x 'translated)
(and (fboundp x)
(compiled-function-p
! (symbol-function x))))))
((ATOM X)
(SETQ Z (OR (AND (MEMQ X (CDR $ALIASES)) (GET X 'NOUN)) (GET X 'VERB)))
--- 476,488 ----
(symbolp x)(or (get x 'translated)
(and (fboundp x)
+ #-sbcl
(compiled-function-p
! (symbol-function x))
! #+sbcl
! (symbolp
! (nth-value
! 2
! (function-lambda-expression
! (symbol-function x))))))))
((ATOM X)
(SETQ Z (OR (AND (MEMQ X (CDR $ALIASES)) (GET X 'NOUN)) (GET X 'VERB)))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wolfgang