I found that the problem reported earlier by Osman
is causes by simple construction
MATCHDECLARE(a,SCALARP)$
MATCHDECLARE(b,TRUE)$
DEFMATCH(tst,a*b)$
tst(x);
On GCL it works but on CLISP and CMUCL it
produces error saying that CAR of LAMBDA
is impossible.
There is two ways to fix the problem. First, to modify
functions makepreds, defmatch1 (matcom.lisp) which
form lambda expression for the function tst.
Unfortunately my attempt to make them return
#'(lambda ...) instead of '(lambda ...) failed.
It seems that these functions are supposed to produce
list and if I replace their value it by #'(labmda ...)
it immediately causes errors in other pieces of code
when Maxima tries to get CAR/CDR of it.
So, I suggest other method to fix the problem. These
lambda expressions are actually evaluated by the function
mapplay1 (mlisp.lisp). The following modification
to this function does the job
------------------------------------------------------------------------------
diff -uNr maxima-5.6-orig/src/mlisp.lisp
maxima-5.6-1/src/mlisp.lisp
--- maxima-5.6-orig/src/mlisp.lisp Sun May 6 22:27:49 2001
+++ maxima-5.6-1/src/mlisp.lisp Sun Dec 2 18:39:35 2001
@@ -140,6 +140,8 @@
#+cl
((functionp fn)
(apply fn args))
+ #+cl
+ ((EQ (CAR FN) 'LAMBDA) (APPLY (COERCE FN 'FUNCTION)
ARGS))
#-cl
((EQ (CAR FN) 'LAMBDA) (APPLY FN ARGS))
#+(and Lispm (not cl))
--------------------------------------------------------------------------
If nobody objects I'll upload this patch to SourceForge.
Vadim
--
[ Vadim V. Zhytnikov <vvzhy@mail.ru> <vvzhy@td.lpi.ac.ru> ]