slots)))))))
\f
(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)
(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)
(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)))
((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)
((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?
(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
(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
(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)
(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
""))
(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)))