Move weak sets from predicate-metadata to boot.
authorChris Hanson <org/chris-hanson/cph>
Tue, 16 Jan 2018 04:24:48 +0000 (20:24 -0800)
committerChris Hanson <org/chris-hanson/cph>
Tue, 16 Jan 2018 04:31:17 +0000 (20:31 -0800)
Also flesh out slightly for future use.

src/runtime/predicate-metadata.scm

index 67cd2ebe975af4477da8faeba37525462235c006..346d93e3b51b52cf92e36bfe61c207e89a7891ad 100644 (file)
@@ -112,46 +112,6 @@ USA.
       (event-distributor/invoke! event:predicate-metadata
                                 'set-tag<=! tag superset)
       (error "Tag already has this superset:" tag superset)))
-\f
-(define (%make-weak-set)
-  (%weak-cons 'weak-set '()))
-
-(define (%weak-set->list weak-set)
-  (weak-list->list (weak-cdr weak-set)))
-
-(define (%add-to-weak-set item weak-set)
-  (let loop
-      ((this (weak-cdr weak-set))
-       (prev weak-set))
-    (if (weak-pair? this)
-       (let ((item* (%weak-car this))
-             (next (weak-cdr this)))
-         (cond ((not item*)
-                (weak-set-cdr! prev next)
-                (loop next prev))
-               ((eq? item item*)
-                #f)
-               (else
-                (loop next this))))
-       (begin
-         (weak-set-cdr! prev (%weak-cons item '()))
-         #t))))
-
-(define (%weak-set-any predicate weak-set)
-  (let loop
-      ((this (weak-cdr weak-set))
-       (prev weak-set))
-    (if (weak-pair? this)
-       (let ((item (%weak-car this))
-             (next (weak-cdr this)))
-         (cond ((not item)
-                (weak-set-cdr! prev next)
-                (loop next prev))
-               ((predicate item)
-                #t)
-               (else
-                (loop next this))))
-       #f)))
 
 (define event:predicate-metadata (make-event-distributor))
 \f