Commit 097fa96a authored by Daniel Kochmański's avatar Daniel Kochmański

cmp: coerce: resolve fixme for atomic complex specifier

it is not true, that

  (type= '(complex) '(complex double-float)) == T

so we may put complex in +coercion-table+.
parent d7c351c7
......@@ -215,6 +215,9 @@
(single-float . (float x 0.0f0))
(double-float . (float x 0.0d0))
(long-float . (float x 0.0l0))
(complex . (let ((y x))
(declare (:read-only y))
(complex (realpart y) (imagpart y))))
(base-char . (character x))
(character . (character x))
(function . (si::coerce-to-function x))
......@@ -251,15 +254,7 @@
when (eq type a-type)
do (return (subst value 'x template))))
;; FIXME! COMPLEX cannot be in +coercion-table+ because
;; (type= '(complex) '(complex double-float)) == T
((eq type 'COMPLEX)
`(let ((y ,value))
(declare (:read-only y))
(complex (realpart y) (imagpart y))))
;; Complex types defined with DEFTYPE.
;; Derived types defined with DEFTYPE.
((and (atom type)
(setq first (si:get-sysprop type 'SI::DEFTYPE-DEFINITION)))
(expand-coerce form value `',(funcall first nil) env))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment