Rewrite SUBTYPEP so that it ignores recursive type declarations using CONS

parent 49ed81bb
......@@ -1090,6 +1090,11 @@ if not possible."
;; are strictly supported.
;;
(defun register-cons-type (&optional (car-type '*) (cdr-type '*))
;; The problem with the code below is that it does not suport infinite
;; recursion. Instead we just canonicalize everything to CONS, irrespective
;; of whether the arguments are valid types or not!
(canonical-type 'CONS)
#+(or)
(let ((car-tag (if (eq car-type '*) -1 (canonical-type car-type)))
(cdr-tag (if (eq cdr-type '*) -1 (canonical-type cdr-type))))
(cond ((or (zerop car-tag) (zerop cdr-tag))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment