From 515b9be6efa979285b11a948208fc46a5514bec4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 15 Jan 2018 20:24:48 -0800 Subject: [PATCH] Move weak sets from predicate-metadata to boot. Also flesh out slightly for future use. --- src/runtime/predicate-metadata.scm | 40 ------------------------------ 1 file changed, 40 deletions(-) diff --git a/src/runtime/predicate-metadata.scm b/src/runtime/predicate-metadata.scm index 67cd2ebe9..346d93e3b 100644 --- a/src/runtime/predicate-metadata.scm +++ b/src/runtime/predicate-metadata.scm @@ -112,46 +112,6 @@ USA. (event-distributor/invoke! event:predicate-metadata 'set-tag<=! tag superset) (error "Tag already has this superset:" tag superset))) - -(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)) -- 2.25.1