Commit bf63b936 authored by Michał Herda's avatar Michał Herda 🤔


We add a SUBTYPEP test that checks SUBTYPEP relationship for CONS types
with SATISFIES types in their CARs and CDRs.

Whether t1 is a subtype of t2 depends on a series of RANDOM calls at
typechecking time - sometimes it might be a subtype, it might not.

This test is added because I see SBCL and CCL failures in this case.

In addition to the test, we define four functions named
subtypep.cons.44.{foo,bar,baz,qux}. This is because the CLHS states that the
type specifier SATISFIES "denotes the set of all objects that satisfy the
predicate PREDICATE-NAME, which must be a symbol whose global function
definition is a one-argument predicate."
parent ed4a6bd6
......@@ -374,3 +374,20 @@
(and (not sub1) (not sub2))))))
(defun (x) (declare (ignore x)) (= 1 (random 2)))
(defun (x) (declare (ignore x)) (= 1 (random 2)))
(defun subtypep.cons.44.baz (x) (declare (ignore x)) (= 1 (random 2)))
(defun subtypep.cons.44.qux (x) (declare (ignore x)) (= 1 (random 2)))
(deftest subtypep.cons.44
(let* ((t1 `(cons (not float)))
(t2 `(or (cons (satisfies
(cons (satisfies subtypep.cons.44.baz)
(satisfies subtypep.cons.44.qux)))))
(multiple-value-bind (sub1 good1)
(subtypep* t1 t2)
(multiple-value-bind (sub2 good2)
(subtypep* `(not ,t2) `(not ,t1))
(and (not sub1) (not sub2) (not good1) (not good2)))))
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