(!define-type-method (cons :simple-=) (type1 type2)
(declare (type cons-type type1 type2))
- (multiple-value-bind (match win)
+ (multiple-value-bind (car-match car-win)
(type= (cons-type-car-type type1) (cons-type-car-type type2))
- (if (and match win)
+ (multiple-value-bind (cdr-match cdr-win)
(type= (cons-type-cdr-type type1) (cons-type-cdr-type type2))
- (values nil win))))
+ (cond ((and car-match cdr-match)
+ (aver (and car-win cdr-win))
+ (values t t))
+ (t
+ (values nil
+ ;; FIXME: Ideally we would like to detect and handle
+ ;; (CONS UNKNOWN INTEGER) (CONS UNKNOWN SYMBOL) => NIL, T
+ ;; but just returning a secondary true on (and car-win cdr-win)
+ ;; unfortunately breaks other things. --NS 2006-08-16
+ (and (or (and (not car-match) car-win)
+ (and (not cdr-match) cdr-win))
+ (not (and (cons-type-might-be-empty-type type1)
+ (cons-type-might-be-empty-type type2))))))))))
(!define-type-method (cons :simple-subtypep) (type1 type2)
(declare (type cons-type type1 type2))
(when (< handle 0)\r
(error "Couldn't spawn program: ~A" (strerror)))\r
(setf proc\r
- (if wait \r
- (make-process :pid handle\r
- :%status :exited\r
- :input input-stream\r
- :output output-stream\r
- :error error-stream\r
- :status-hook status-hook\r
- :cookie cookie\r
- :exit-code handle)\r
- (make-process :pid handle\r
- :%status :running\r
- :input input-stream\r
- :output output-stream\r
- :error error-stream\r
- :status-hook status-hook\r
- :cookie cookie)))\r
- (push proc *active-processes*)))))))\r
+ (if wait \r
+ (make-process :pid handle\r
+ :%status :exited\r
+ :input input-stream\r
+ :output output-stream\r
+ :error error-stream\r
+ :status-hook status-hook\r
+ :cookie cookie\r
+ :exit-code handle)\r
+ (make-process :pid handle\r
+ :%status :running\r
+ :input input-stream\r
+ :output output-stream\r
+ :error error-stream\r
+ :status-hook status-hook\r
+ :cookie cookie)))\r
+ (push proc *active-processes*)))))))\r
(dolist (fd *close-in-parent*)\r
- (sb-unix:unix-close fd)))\r
+ (sb-unix:unix-close fd)))\r
(unless proc\r
(dolist (fd *close-on-error*)\r
- (sb-unix:unix-close fd)))\r
+ (sb-unix:unix-close fd)))\r
\r
proc))\r
\r
#o666)\r
(unless fd\r
(error #-win32 "~@<couldn't open \"/dev/null\": ~2I~_~A~:>"\r
- #+win32 "~@<couldn't open \"nul\" device: ~2I~_~A~:>"\r
+ #+win32 "~@<couldn't open \"nul\" device: ~2I~_~A~:>"\r
(strerror errno)))\r
(push fd *close-in-parent*)\r
(values fd nil)))\r
'(4 nil))))
"Called a method!Called a method!"))
-(defclass super ()
- ((b :initform 3)
+(defclass super ()
+ ((b :initform 3)
(a :initarg :a)))
(assert (string= (with-output-to-string (*trace-output*)
(setf (find-class 'to-be-type-ofed) nil)
(assert (eq (type-of (make-instance class)) class)))
\f
+;;; accuracy of CONS :SIMPLE-TYPE-=
+(deftype goldbach-1 () '(satisfies even-and-greater-then-two-p))
+(deftype goldbach-2 () ' (satisfies sum-of-two-primes-p))
+
+(multiple-value-bind (ok win)
+ (sb-kernel:type= (sb-kernel:specifier-type '(cons goldbach1 integer))
+ (sb-kernel:specifier-type '(cons goldbach1 integer)))
+ (assert ok)
+ (assert win))
+
+;; See FIXME in type method for CONS :SIMPLE-TYPE-=
+#+nil
+(multiple-value-bind (ok win)
+ (sb-kernel:type= (sb-kernel:specifier-type '(cons goldbach1 integer))
+ (sb-kernel:specifier-type '(cons goldbach1 single-float)))
+ (assert (not ok))
+ (assert win))
+
+(multiple-value-bind (ok win)
+ (sb-kernel:type= (sb-kernel:specifier-type '(cons goldbach1 integer))
+ (sb-kernel:specifier-type '(cons goldbach2 single-float)))
+ (assert (not ok))
+ (assert (not win)))
;;; success
(sb-kernel:specifier-type '(simple-array an-unkown-type (8))))))
(assert
- (sb-kernel:type/= (sb-kernel:specifier-type 'cons)
+ (sb-kernel:type/= (sb-kernel:specifier-type 'cons)
(sb-kernel:specifier-type '(cons single-float single-float))))
(multiple-value-bind (match win)
- (sb-kernel:type= (sb-kernel:specifier-type '(cons integer))
+ (sb-kernel:type= (sb-kernel:specifier-type '(cons integer))
(sb-kernel:specifier-type '(cons)))
(assert (and (not match) win)))
;;; 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.9.15.34"
+"0.9.15.35"