[armedbear-cvs] r12939 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Sat Oct 2 19:04:02 UTC 2010
Author: ehuelsmann
Date: Sat Oct 2 15:04:00 2010
New Revision: 12939
Log:
Fix COERCE on a COMPLEX, being coerced to (COMPLEX <anything>);
this is excercised by Maxima.
Modified:
trunk/abcl/src/org/armedbear/lisp/coerce.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/coerce.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/coerce.lisp (original)
+++ trunk/abcl/src/org/armedbear/lisp/coerce.lisp Sat Oct 2 15:04:00 2010
@@ -105,9 +105,14 @@
(coerce-to-function object))
((and (consp result-type)
(eq (%car result-type) 'complex))
+ (when (complexp object)
+ (return-from coerce
+ (complex (coerce (realpart object) (cadr result-type))
+ (coerce (imagpart object) (cadr result-type)))))
(if (memq (%cadr result-type)
'(float single-float double-float short-float long-float))
- (complex object 0.0)
+ (complex (coerce object (cadr result-type))
+ (coerce 0.0 (cadr result-type)))
object))
((and (consp result-type)
(eq (%car result-type) 'AND))
More information about the armedbear-cvs
mailing list