[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: make upgraded-complex-part-type less clever
From:       Christophe Rhodes via Sbcl-commits <sbcl-commits () lists ! sourceforge ! net>
Date:       2017-11-23 11:43:35
Message-ID: 1511437415.897805.11589 () sfp-scm-3 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  cc8f694255de91ced051c351526774570af47ddf (commit)
      from  d7650e59779b72fecacd088889f551ad4ae04249 (commit)

- Log -----------------------------------------------------------------
commit cc8f694255de91ced051c351526774570af47ddf
Author: Christophe Rhodes <c.rhodes@gold.ac.uk>
Date:   Wed Nov 22 15:47:50 2017 +0000

    make upgraded-complex-part-type less clever
    
    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.
---
 src/compiler/generic/vm-type.lisp | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/compiler/generic/vm-type.lisp b/src/compiler/generic/vm-type.lisp
index 51c4bb4..f3e3091 100644
--- a/src/compiler/generic/vm-type.lisp
+++ b/src/compiler/generic/vm-type.lisp
@@ -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.

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic