#| -*-Scheme-*-
-$Id: list.scm,v 14.38 2004/01/09 21:12:16 cph Exp $
+$Id: list.scm,v 14.39 2004/11/17 04:20:46 cph Exp $
Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology
Copyright 1992,1993,1994,1995,1996,2000 Massachusetts Institute of Technology
(error:wrong-type-argument items "list" 'FIND-MATCHING-ITEM))
#f))))
-(define list-transform-positive keep-matching-items)
-(define list-transform-negative delete-matching-items)
-(define list-search-positive find-matching-item)
-
-(define (list-search-negative items predicate)
- (find-matching-item items
- (lambda (item)
- (not (predicate item)))))
+(define (find-non-matching-item items predicate)
+ (let loop ((items* items))
+ (if (pair? items*)
+ (if (predicate (car items*))
+ (loop (cdr items*))
+ (car items*))
+ (begin
+ (if (not (null? items*))
+ (error:wrong-type-argument items "list" 'FIND-MATCHING-ITEM))
+ #f))))
\f
(define (delete-matching-items! items predicate)
(letrec
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.507 2004/11/04 03:00:38 cph Exp $
+$Id: runtime.pkg,v 14.508 2004/11/17 04:20:57 cph Exp $
Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
(files "list")
(parent (runtime))
(export ()
+ (list-search-negative find-non-matching-item)
+ (list-search-positive find-matching-item)
+ (list-transform-negative delete-matching-items)
+ (list-transform-positive keep-matching-items)
add-member-procedure
alist-copy
alist?
except-last-pair!
fifth
find-matching-item
+ find-non-matching-item
first
fold-left
fold-right
list-of-type?
list-of-type?->length
list-ref
- list-search-negative
- list-search-positive
list-tail
- list-transform-negative
- list-transform-positive
list?
list?->length
make-circular-list