X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcross-type.lisp;h=a987067105a39861dbe4e50b9036a48d3e52fd99;hb=334af30b26555f0bf706f7157b399bdbd4fad548;hp=5a70e12011fe98a1c053709aa0e137ca9f0f60ee;hpb=ce62508ec1a0f39008c18a2a5a06461eabe662c0;p=sbcl.git diff --git a/src/code/cross-type.lisp b/src/code/cross-type.lisp index 5a70e12..a987067 100644 --- a/src/code/cross-type.lisp +++ b/src/code/cross-type.lisp @@ -9,7 +9,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB!IMPL") +(in-package "SB!KERNEL") ;;; Is X a fixnum in the target Lisp? (defun fixnump (x) @@ -306,7 +306,7 @@ host-object target-type-spec)))) -;;; This implementation is an incomplete, portable version for use at +;;; This is an incomplete, portable implementation for use at ;;; cross-compile time only. (defun ctypep (obj ctype) (check-type ctype ctype) @@ -334,24 +334,7 @@ (symbol (make-member-type :members (list x))) (number - (let* ((num (if (complexp x) (realpart x) x)) - (res (make-numeric-type - :class (etypecase num - (integer 'integer) - (rational 'rational) - (float 'float)) - :format (if (floatp num) - (float-format-name num) - nil)))) - (cond ((complexp x) - (setf (numeric-type-complexp res) :complex) - (let ((imag (imagpart x))) - (setf (numeric-type-low res) (min num imag)) - (setf (numeric-type-high res) (max num imag)))) - (t - (setf (numeric-type-low res) num) - (setf (numeric-type-high res) num))) - res)) + (ctype-of-number x)) (array (let ((etype (specifier-type (array-element-type x)))) (make-array-type :dimensions (array-dimensions x)