mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-25 22:12:40 -08:00
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+.
This commit is contained in:
parent
d7c351c76a
commit
097fa96ae0
1 changed files with 4 additions and 9 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue