> > (SIMPLIFY
> > `((%DERIVATIVE)
> > - (SYSTEM::UNQUOTE (TRD-MSYMEVAL $Y '$Y) (TRD-MSYMEVAL $X '$X) 2)))
> > + ,(TRD-MSYMEVAL $Y '$Y), (TRD-MSYMEVAL $X '$X) 2))
>
I said that this SYSTEM::UNQUOTE business
> Could be a bug in Clisp.
but actually no, Clisp seems to be right.
It turns out that the function TR-INFAMOUS-NOUN-FORM expresses its
return value by a doubly nested backquoted form. Now, according to
CLtL2 (Appendix C of the online version),
In general, Common Lisp guarantees the result of an expression
with backquotes nested to depth k only after k successive
evaluations have been performed; the results after fewer than k
evaluations are implementation-dependent.
I can't deduce such a statement from the CLHS, though.
So, in our case, the result of the first evaluation is written to the
*.LISP file but (if we believe CLtL2) only the second evaluation of
this form would give a well-defined result.
To avoid this situation, it suffices to expand the innermost
backquoted form, which corresponds to the second evaluation, following
the rules given in the CLHS in section 2.4.6 (Backquote).
`($ANY . (SIMPLIFY `(,',OP ,,@ARGS)))
expands to
`($any . (simplify (append (list ',op) (list ,@args))))
This can be simplified somewhat and suggests the following patch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: transl.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/transl.lisp,v
retrieving revision 1.3
diff -u -r1.3 transl.lisp
--- transl.lisp 10 Jun 2002 02:57:39 -0000 1.3
+++ transl.lisp 29 Mar 2003 01:40:39 -0000
@@ -944,7 +944,7 @@
`(,(CAAR FORM) ARRAY))
(T `(,(CAAR FORM)))))
(ARGS (TR-ARGS (CDR FORM))))
- `($ANY . (SIMPLIFY `(,',OP ,,@ARGS)))))
+ `($any . (simplify (list ',op ,@args)))))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I checked that both Clisp and SBCL with the Clisp generated ode2.LISP
pass the current test suite.
Wolfgang