Use package system to create upwards-compatibility links.
authorChris Hanson <org/chris-hanson/cph>
Wed, 17 Nov 2004 04:20:57 +0000 (04:20 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 17 Nov 2004 04:20:57 +0000 (04:20 +0000)
v7/src/runtime/list.scm
v7/src/runtime/runtime.pkg

index dddb93d0aa420b3ad81e213b49e648c812cd00cd..9f42becda6df7b5112c56916fdbf273669599a3b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-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
@@ -743,14 +743,16 @@ USA.
              (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
index f0ca2893aa7f50b4b17759729c5db8503253d140..b755d6445b7f223af922813ee32de32016d932c7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-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
@@ -2043,6 +2043,10 @@ USA.
   (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?
@@ -2110,6 +2114,7 @@ USA.
          except-last-pair!
          fifth
          find-matching-item
+         find-non-matching-item
          first
          fold-left
          fold-right
@@ -2134,11 +2139,7 @@ USA.
          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