(in-package "SB!KERNEL")
-(file-comment
- "$Header$")
-
(!begin-collecting-cold-init-forms)
;;; 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)
+(defmacro !def-type-translator (name arglist &body body)
(check-type name symbol)
;; 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.
\f
;;;; utilities
-;;; Like ANY and EVERY, except that we handle two-arg uncertain predicates.
-;;; If the result is uncertain, then we return Default from the block PUNT.
-;;; If LIST-FIRST is true, then the list element is the first arg, otherwise
-;;; the second.
+;;; Like ANY and EVERY, except that we handle two-arg uncertain
+;;; predicates. If the result is uncertain, then we return DEFAULT
+;;; from the block PUNT-TYPE-METHOD. If LIST-FIRST is true, then the
+;;; list element is the first arg, otherwise the second.
+;;;
+;;; FIXME: The way that we return from PUNT-TYPE-METHOD rather ruins
+;;; the analogy with SOME and EVERY, and completely surprised me (WHN)
+;;; when I was trying to maintain code which uses these macros. I
+;;; think it would be a good idea to redo these so that they really
+;;; are analogous to EVERY and SOME. And then, while we're at it, we
+;;; could also make them functions (perhaps inline) instead of macros.
(defmacro any-type-op (op thing list &key (default '(values nil nil))
list-first)
(let ((n-this (gensym))
(,n-uncertain nil))
(dolist (,n-this ,list
(if ,n-uncertain
- (return-from PUNT ,default)
+ (return-from punt-type-method ,default)
nil))
(multiple-value-bind (,n-val ,n-win)
,(if list-first
,(if list-first
`(,op ,n-this ,n-thing)
`(,op ,n-thing ,n-this))
- (unless ,n-win (return-from PUNT ,default))
+ (unless ,n-win (return-from punt-type-method ,default))
(unless ,n-val (return nil)))))))
;;; Compute the intersection for types that intersect only when one is a