CVS CMUCL vs maxima



Raymond Toy ?????:
> The latest CVS versions of CMUCL have a few problems with maxima.
> 
> First, the USER package no longer exists.  This is easily fixed.
> 
> Second, cmucl now says (type-of 1) is an (integer 1 1).  This breaks
> maclisp-typep in commac.lisp because (maclisp-typep 1) returns
> '(integer 1 1) instead of 'fixnum.   In turn, this means diff(x^2,x),
> doesn't actually differentiate anymore, among other problems.
> 
> maclisp-typep is a pretty complex way of getting some standardized
> types and I propose the following replacement.  This appears to work
> and gives the expected test results.  I think a better alternative
> would be to find all uses of maclisp-typep (and ml-typep) and replace
> with with a real CL type-of, CL typep, or CL subtypep as appropriate.
> 
> 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))))))
> 

Life is full of funny things.  Just an hour (really!!!)
befor I read your messge I've found out that Maxima
has very similar problems with recent clisp CVS
(in May it was OK).  One of the problems is
that now (type-of 1) retuns BIT.  Hence unevaluated
diff(x+1,x), diff(x^2,x) etc.  Your fix resolves this
very trouble but some other still exist.
More details tomorrow. It's getting late...

-- 
      Vadim V. Zhytnikov

       <vvzhy@mail.ru>
      <vvzhy@netorn.ru>