X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftypedefs.lisp;h=bcbfecea2be2161a06f4a08d6c116eece6e23be0;hb=bee53328c93be3433477821131ab805557476c8b;hp=57f432e3af966b9b6d18478fd8139db1d13b554b;hpb=cbaa1997bb097a55d108df592ac3b7eb4a703fff;p=sbcl.git diff --git a/src/code/typedefs.lisp b/src/code/typedefs.lisp index 57f432e..bcbfece 100644 --- a/src/code/typedefs.lisp +++ b/src/code/typedefs.lisp @@ -27,7 +27,7 @@ ;;; Define the translation from a type-specifier to a type structure for ;;; some particular type. Syntax is identical to DEFTYPE. (defmacro !def-type-translator (name arglist &body body) - (check-type name symbol) + (declare (type symbol name)) ;; FIXME: Now that the T%CL hack is ancient history and we just use CL ;; instead, we can probably return to using PARSE-DEFMACRO here. ;; @@ -88,30 +88,7 @@ (declare (type ctype type)) `(specifier-type ',(type-specifier type))) -;;;; utilities - -;;; sort of like ANY and EVERY, except: -;;; * We handle two-VALUES predicate functions like SUBTYPEP. (And -;;; if the result is uncertain, then we return (VALUES NIL NIL), -;;; just like SUBTYPEP.) -;;; * THING is just an atom, and we apply OP (an arity-2 function) -;;; successively to THING and each element of LIST. -(defun any/type (op thing list) - (declare (type function op)) - (let ((certain? t)) - (dolist (i list (values nil certain?)) - (multiple-value-bind (sub-value sub-certain?) (funcall op thing i) - (if sub-certain? - (when sub-value (return (values t t))) - (setf certain? nil)))))) -(defun every/type (op thing list) - (declare (type function op)) - (let ((certain? t)) - (dolist (i list (if certain? (values t t) (values nil nil))) - (multiple-value-bind (sub-value sub-certain?) (funcall op thing i) - (if sub-certain? - (unless sub-value (return (values nil t))) - (setf certain? nil)))))) +;;;; miscellany ;;; Look for nice relationships for types that have nice relationships ;;; only when one is a hierarchical subtype of the other.