From 6062d0350bcba86a7719f92151103574f83d43ac Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 15 Apr 2018 01:29:19 -0700 Subject: [PATCH] Eliminate references to now-deprecated definitions. --- src/runtime/defstr.scm | 32 ++++++++++++++++---------------- src/runtime/graphics.scm | 9 ++++----- src/runtime/infutl.scm | 16 ++++++++-------- src/runtime/pathname.scm | 2 +- src/runtime/primitive-io.scm | 2 +- src/runtime/system.scm | 6 +++--- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/runtime/defstr.scm b/src/runtime/defstr.scm index 58aa5ab16..76cbccb41 100644 --- a/src/runtime/defstr.scm +++ b/src/runtime/defstr.scm @@ -173,9 +173,9 @@ differences: slots))))))) (define (find-option keyword options) - (find-matching-item options - (lambda (option) - (eq? (option/keyword option) keyword)))) + (find (lambda (option) + (eq? (option/keyword option) keyword)) + options)) (define (find-options keyword options) (filter (lambda (option) @@ -192,9 +192,9 @@ differences: (let ((conflict (let ((name (option/argument option))) (and name - (find-matching-item options - (lambda (option*) - (eq? (option/argument option*) name))))))) + (find (lambda (option*) + (eq? (option/argument option*) name)) + options))))) (if conflict (error "Conflicting constructor definitions:" (option/original option) @@ -322,13 +322,13 @@ differences: (transformer (cddr entry))) (let ((option* (and (not can-be-duplicated?) - (find-matching-item options - (let ((keyword (car normal-option))) - (lambda (option*) - (eq? (if (pair? option*) - (car option*) - option*) - keyword))))))) + (find (let ((keyword (car normal-option))) + (lambda (option*) + (eq? (if (pair? option*) + (car option*) + option*) + keyword))) + options)))) (if option* (error "Duplicate structure option:" option option*))) (cons (let ((option* (transformer normal-option context))) @@ -486,9 +486,9 @@ differences: ((not (pair? slots))) (let ((name (slot/name (caar slots)))) (let ((slot* - (find-matching-item (cdr slots) - (lambda (slot) - (eq? (slot/name (car slot)) name))))) + (find (lambda (slot) + (eq? (slot/name (car slot)) name)) + (cdr slots)))) (if slot* (error "Structure slots must not have duplicate names:" (cdar slots) diff --git a/src/runtime/graphics.scm b/src/runtime/graphics.scm index 575359ea0..81c8e8140 100644 --- a/src/runtime/graphics.scm +++ b/src/runtime/graphics.scm @@ -200,15 +200,14 @@ USA. ((graphics-device? object) (test-type (graphics-device/type object))) ((not object) - (or (list-search-positive graphics-types - graphics-device-type/available?) + (or (find graphics-device-type/available? graphics-types) (and error? (error "No graphics types supported.")))) (else (let ((type - (list-search-positive graphics-types - (lambda (type) - (eq? object (graphics-device-type/name type)))))) + (find (lambda (type) + (eq? object (graphics-device-type/name type))) + graphics-types))) (if type (test-type type) (and error? diff --git a/src/runtime/infutl.scm b/src/runtime/infutl.scm index 8a684db80..f8020196e 100644 --- a/src/runtime/infutl.scm +++ b/src/runtime/infutl.scm @@ -228,10 +228,10 @@ USA. (define (add-directory-rewriting-rule! match replace) (let ((match (pathname-as-directory (merge-pathnames match)))) (let ((rule - (list-search-positive (directory-rewriting-rules) - (lambda (rule) - (equal? (pathname-directory (car rule)) - (pathname-directory match)))))) + (find (lambda (rule) + (equal? (pathname-directory (car rule)) + (pathname-directory match))) + (directory-rewriting-rules)))) (if rule (set-cdr! rule replace) (directory-rewriting-rules @@ -241,10 +241,10 @@ USA. (define (rewrite-directory pathname) (let ((rule - (list-search-positive (directory-rewriting-rules) - (lambda (rule) - (directory-prefix? (pathname-directory pathname) - (pathname-directory (car rule))))))) + (find (lambda (rule) + (directory-prefix? (pathname-directory pathname) + (pathname-directory (car rule)))) + (directory-rewriting-rules)))) (->namestring (if rule (merge-pathnames diff --git a/src/runtime/pathname.scm b/src/runtime/pathname.scm index 9567a0148..054de2de7 100644 --- a/src/runtime/pathname.scm +++ b/src/runtime/pathname.scm @@ -640,7 +640,7 @@ these rules: (define (%find-library-directory) (pathname-simplify - (or (find-matching-item library-directory-path file-directory?) + (or (find file-directory? library-directory-path) (error "Can't find library directory.")))) (define (%find-library-file pathname) diff --git a/src/runtime/primitive-io.scm b/src/runtime/primitive-io.scm index d8c60fc8f..7ef4f15c4 100644 --- a/src/runtime/primitive-io.scm +++ b/src/runtime/primitive-io.scm @@ -744,7 +744,7 @@ USA. (define (find-dld-handle predicate) (with-thread-mutex-lock dld-handles-mutex (lambda () - (find-matching-item dld-handles predicate)))) + (find predicate dld-handles)))) (define (all-dld-handles) (with-thread-mutex-lock dld-handles-mutex diff --git a/src/runtime/system.scm b/src/runtime/system.scm index 805b64c07..080d40c04 100644 --- a/src/runtime/system.scm +++ b/src/runtime/system.scm @@ -112,9 +112,9 @@ USA. "")) (define (find-entry name) - (find-matching-item subsystem-identifications - (lambda (entry) - (match-entry? name entry)))) + (find (lambda (entry) + (match-entry? name entry)) + subsystem-identifications)) (define (match-entry? name entry) (let ((s (car entry))) -- 2.25.1