Subject: [clisp-list] maxima breaks with CVS clisp

From: Sam Halliday <[email-masked]>
Date: Wed Jul 9 17:06:27 2003

hi there,

i have been on the clisp mailing list lately, as i was wanting to find a
patch to clisp-2.30 which fixed the floating point issues... i was
pointed to CVS which has these issues fixed. now however, i am getting
even stranger results from the symbolic math package maxima; with
clisp-2.30 (which is not reccomended, and i experience a few floating
point tests fail during make check), if i type a simple differentiation
like

(C1) diff(sin(x),x);
(D1)                                COS(x)

the result is as expected. if however, i use build maxima with clisp
CVS, i get this;

(C1) diff(sin(x),x);
                                  d
(D1)                              -- (SIN(x))
                                  dx

which as you can tell is not what i wanted. i recompiled maxima to the
version of clisp i have installed. since this is only apparent when i
use clisp CVS and not 2.30, i am reporting this on the clisp mailing
list also, as it is clearly a bug somewhere, and i am not experienced
enough in either package to find what could be causing it.

in the meantime, to allow me to sleep soundly at night; if anyone has a
patch against clisp-2.30 which fixes the floating point issues, i would
be very grateful to them. i have gcc-3.2.3, so clisp-2.29 does not
compile; also gcl has sed syntax errors in the configure script so i
cant build it. i am running GNU/Linux from Scratch.

cheers,
Sam
PS: please CC me, i am not subscribed to either list as the sourceforge
servers seem to be down... (again).
-- 
The pollution's at that awkward stage. Too thick to navigate and too
thin to cultivate.
-- Doug Sneyd

---

From: Raymond Toy <[email-masked]>
Date: Thu Jul 10 06:47:10 2003

>>>>> "Sam" == Sam Halliday <[email-masked]> writes:

    Sam> (C1) diff(sin(x),x);
    Sam> (D1)                                COS(x)

    Sam> the result is as expected. if however, i use build maxima with clisp
    Sam> CVS, i get this;

    Sam> (C1) diff(sin(x),x);
    Sam>                                   d
    Sam> (D1)                              -- (SIN(x))
    Sam>                                   dx

This is caused by a recently discovered bug.  CVS CMUCL also fails in
this way.

Here is a potential solution.  Just use the following replacement in
src/commac.lisp.

Ray

(defun maclisp-typep (x &optional type)
  (cond (type
	 (lisp:let ((pred (get type 'ml-typep)))
	   (cond (pred
		  (funcall pred x))
		 (t (typep x type)))))
	(t
	 (typecase x
	   (cl:cons 'list)
	   (cl:fixnum 'fixnum)
	   (cl:integer 'bignum)
	   (cl:float 'flonum)
	   (cl:number 'number)
	   (cl:array 'array)
	   (cl:hash-table 'hash-table)
	   (t
	    (type-of x-type))))))

---

From: Sam Steingold <[email-masked]>
Date: Thu Jul 10 07:57:12 2003

> * In message <[email-masked]>
> * On the subject of "Re: [Maxima] maxima breaks with CVS clisp"
> * Sent on Thu, 10 Jul 2003 09:46:09 -0400
> * Honorable Raymond Toy <[email-masked]> writes:
>

I am confused.  If this is a maxima bug, why does it manifest itself on
_both_ CVS CLISP and CVS CMUCL but not released versions?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
If you're passed on the right, you're in the wrong lane.

---

From: Raymond Toy <[email-masked]>
Date: Thu Jul 10 09:05:19 2003

>>>>> "Sam" == Sam Steingold <[email-masked]> writes:

    Sam> I am confused.  If this is a maxima bug, why does it manifest itself on
    Sam> _both_ CVS CLISP and CVS CMUCL but not released versions?

It is a maxima bug.  It's caused by (type-of 1) not returning 'fixnum
anymore.  CVS CMUCL returns '(integer 1 1) and, I think, CVS Clisp
returns 'bit.

The original maxima code was essentially testing to see if (typep 3
(type-of 1)), which no longer works.

Ray

---

From: "Vadim V. Zhytnikov" <[email-masked]>
Date: Sat Jul 12 00:43:12 2003

> 	   (cl:hash-table 'hash-table)

Maxima passes all tests on CLISP CVS
if I replace the last line by

  	    (type-of x))))))

Vadim

-- 
      Vadim V. Zhytnikov

       <[email-masked]>
      <[email-masked]>

---

From: Raymond Toy <[email-masked]>
Date: Thu Jul 24 11:16:34 2003

>>>>> "Vadim" == Vadim V Zhytnikov <[email-masked]> writes:

    Vadim> Maxima passes all tests on CLISP CVS
    Vadim> if I replace the last line by

    Vadim>   	    (type-of x))))))

Oops!  I'll fix this and commit it shortly.  This will be the
implementation for all Lisps.

Ray