From 07111ea2a4131f731f5ac23e79cb3d715970a92e Mon Sep 17 00:00:00 2001 From: Alexey Dejneka Date: Fri, 4 Jul 2003 05:18:25 +0000 Subject: [PATCH] 0.8.1.24: * SB-BSD-SOCKETS: test of local sockets tries both stream and datagram kinds; * COMPLEX-= type method: if the second type is unknown, try to reparse it. --- BUGS | 9 ++++----- contrib/sb-bsd-sockets/tests.lisp | 14 +++++++++++--- src/code/cold-init-helper-macros.lisp | 34 ++++++++++++++++----------------- src/code/late-type.lisp | 8 ++++++-- tests/type.before-xc.lisp | 5 +---- tests/type.impure.lisp | 7 +++++++ version.lisp-expr | 2 +- 7 files changed, 47 insertions(+), 32 deletions(-) diff --git a/BUGS b/BUGS index c8cd7e4..9d6ce58 100644 --- a/BUGS +++ b/BUGS @@ -1021,9 +1021,6 @@ WORKAROUND: currently checks for complex arrays seem to be performed by callees.) -258: - (fixed in 0.8.1.3) - 259: (compile nil '(lambda () (aref (make-array 0) 0))) compiles without warning. Analogous cases with the index and length being equal and @@ -1032,14 +1029,16 @@ WORKAROUND: which is canonicalized to NIL. 260: + a. (let* ((s (gensym)) (t1 (specifier-type s))) (eval `(defstruct ,s)) (type= t1 (specifier-type s))) => NIL, NIL - It causes WARNING when defining a structure, a slot of which - contains an instance of the same structure. + (fixed in 0.8.1.24) + + b. The same for CSUBTYPEP. 261: * (let () (list (the (values &optional fixnum) (eval '(values))))) diff --git a/contrib/sb-bsd-sockets/tests.lisp b/contrib/sb-bsd-sockets/tests.lisp index 0959a00..f96e82a 100644 --- a/contrib/sb-bsd-sockets/tests.lisp +++ b/contrib/sb-bsd-sockets/tests.lisp @@ -135,9 +135,17 @@ Tests are in the file tests.lisp and also make good examples. #-sunos (deftest simple-local-client - (let ((s (make-instance 'local-socket :type :stream))) - (format t "~A~%" s) - (socket-connect s "/dev/log") + (let ((s (make-instance 'local-socket :type :datagram))) + (format t "Connecting ~A... " s) + (finish-output) + (handler-case + (socket-connect s "/dev/log") + (socket-error () + (setq s (make-instance 'local-socket :type :stream)) + (format t "failed~%Retrying with ~A... " s) + (finish-output) + (socket-connect s "/dev/log"))) + (format t "ok.~%") (let ((stream (socket-make-stream s :input t :output t :buffering :none))) (format stream "<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored") diff --git a/src/code/cold-init-helper-macros.lisp b/src/code/cold-init-helper-macros.lisp index bcf619e..bed148f 100644 --- a/src/code/cold-init-helper-macros.lisp +++ b/src/code/cold-init-helper-macros.lisp @@ -20,11 +20,11 @@ (defvar *cold-init-forms*)) (defmacro !begin-collecting-cold-init-forms () - #-sb-xc-host '(eval-when (:compile-toplevel :execute) - (when (boundp '*cold-init-forms*) - (warn "discarding old *COLD-INIT-FORMS* value")) - (setf *cold-init-forms* nil)) - #+sb-xc-host nil) + #+sb-xc '(eval-when (:compile-toplevel :execute) + (when (boundp '*cold-init-forms*) + (warn "discarding old *COLD-INIT-FORMS* value")) + (setf *cold-init-forms* nil)) + #-sb-xc nil) ;;; Note: Unlike the analogous COLD-INIT macro in CMU CL, this macro ;;; makes no attempt to simulate a top level situation by treating @@ -33,24 +33,24 @@ ;; In the target Lisp, stuff the forms into a named function which ;; will presumably be executed at the appropriate stage of cold load ;; (i.e. basically as soon as possible). - #-sb-xc-host (progn - (setf *cold-init-forms* - (nconc *cold-init-forms* (copy-list forms))) - nil) + #+sb-xc (progn + (setf *cold-init-forms* + (nconc *cold-init-forms* (copy-list forms))) + nil) ;; In the cross-compilation host Lisp, cold load might not be a ;; meaningful concept and in any case would have happened long ago, ;; so just execute the forms at load time (i.e. basically as soon as ;; possible). - #+sb-xc-host `(progn ,@forms)) + #-sb-xc `(progn ,@forms)) (defmacro !defun-from-collected-cold-init-forms (name) - #-sb-xc-host `(progn - (defun ,name () - ,@*cold-init-forms* - (values)) - (eval-when (:compile-toplevel :execute) - (makunbound '*cold-init-forms*))) - #+sb-xc-host (declare (ignore name))) + #+sb-xc `(progn + (defun ,name () + ,@*cold-init-forms* + (values)) + (eval-when (:compile-toplevel :execute) + (makunbound '*cold-init-forms*))) + #-sb-xc (declare (ignore name))) ;;; FIXME: Consider renaming this file asap.lisp, ;;; and the renaming the various things diff --git a/src/code/late-type.lisp b/src/code/late-type.lisp index 9e66753..1f561ac 100644 --- a/src/code/late-type.lisp +++ b/src/code/late-type.lisp @@ -1148,8 +1148,12 @@ (values nil nil)) (!define-type-method (hairy :complex-=) (type1 type2) - (declare (ignore type1 type2)) - (values nil nil)) + (if (unknown-type-p type2) + (let ((type2 (specifier-type (unknown-type-specifier type2)))) + (if (unknown-type-p type2) + (values nil nil) + (type= type1 type2))) + (values nil nil))) (!define-type-method (hairy :simple-intersection2 :complex-intersection2) (type1 type2) diff --git a/tests/type.before-xc.lisp b/tests/type.before-xc.lisp index 7bc61c5..5b03e45 100644 --- a/tests/type.before-xc.lisp +++ b/tests/type.before-xc.lisp @@ -128,14 +128,11 @@ (assert-secondnil (sb-xc:subtypep t '(satisfies foo))) (assert-secondnil (sb-xc:subtypep t '(and (satisfies foo) (satisfies bar)))) (assert-secondnil (sb-xc:subtypep t '(or (satisfies foo) (satisfies bar)))) - ;; FIXME: Enable these tests when bug 84 is fixed. - #| (assert-secondnil (sb-xc:subtypep '(satisfies foo) nil)) (assert-secondnil (sb-xc:subtypep '(and (satisfies foo) (satisfies bar)) nil)) (assert-secondnil (sb-xc:subtypep '(or (satisfies foo) (satisfies bar)) - nil)) - |#) + nil))) ;;; tests of 2-value quantifieroids FOO/TYPE (macrolet ((2= (v1 v2 expr2) diff --git a/tests/type.impure.lisp b/tests/type.impure.lisp index 294659f..6e4a2e8 100644 --- a/tests/type.impure.lisp +++ b/tests/type.impure.lisp @@ -402,6 +402,13 @@ (deftype bar () 'single-float) (assert (eql (foo (make-array 3 :element-type 'bar :initial-element 0.0f0)) 0.0f0)) + +;;; bug 260a +(assert-t-t + (let* ((s (gensym)) + (t1 (sb-kernel:specifier-type s))) + (eval `(defstruct ,s)) + (sb-kernel:type= t1 (sb-kernel:specifier-type s)))) ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 06de37e..f1f8534 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.1.23" +"0.8.1.24" -- 1.7.10.4