Skip to content

Commit

Permalink
make upgraded-complex-part-type less clever
Browse files Browse the repository at this point in the history
Unfortunately the requirements under CLHS TYPEP constrain the
implementation of UPGRADED-COMPLEX-PART-TYPE severely; the
requirement that all others of the same specialized representation
satisfy the typep requirements individually and severally on real
and imaginary parts means (we believe) that the only possible
implementation of UPGRADED-COMPLEX-PART-TYPE is effectively the
trivial implementation.  Make it so.
  • Loading branch information
csrhodes committed Nov 23, 2017
1 parent d7650e5 commit cc8f694
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/compiler/generic/vm-type.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,9 @@
((eq type *empty-type*) nil)
((not type) (error "Undefined type: ~S" spec))
(t
(let ((ctype (specifier-type `(complex ,spec))))
(cond
((eq ctype *empty-type*) '(eql 0))
((csubtypep ctype (specifier-type '(complex single-float)))
'single-float)
((csubtypep ctype (specifier-type '(complex double-float)))
'double-float)
#!+long-float
((csubtypep ctype (specifier-type '(complex long-float)))
'long-float)
((csubtypep ctype (specifier-type '(complex rational)))
'rational)
(t 'real)))))))
(let ((ctype (specifier-type `(complex ,spec)))) ; error checking
(declare (ignore ctype))
(type-specifier type))))))

;;; Return the most specific integer type that can be quickly checked that
;;; includes the given type.
Expand Down

0 comments on commit cc8f694

Please sign in to comment.