]> gitweb.factorcode.org Git - factor.git/commitdiff
make find-all-files and find-in-program-files not take the traversal method
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 27 Feb 2009 03:50:01 +0000 (21:50 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 27 Feb 2009 03:50:01 +0000 (21:50 -0600)
basis/io/directories/search/search-docs.factor
basis/io/directories/search/search-tests.factor
basis/io/directories/search/search.factor
basis/io/directories/search/windows/windows.factor

index 99135b795344ea28e079854452987b3e51359e94..818899606da745d49dafbe0fae39237fd2a23a13 100644 (file)
@@ -38,7 +38,7 @@ HELP: find-in-directories
 
 HELP: find-all-files
 { $values
-     { "path" "a pathname string" } { "bfs?" "a boolean, breadth-first or depth-first" } { "quot" quotation }
+     { "path" "a pathname string" } { "quot" quotation }
      { "paths/f" "a sequence of pathname strings or f" }
 }
 { $description "Finds all files in the input directory matching the predicate quotation in a breadth-first or depth-first traversal." } ;
index a8b8bf9215b99570d2eb3f197c5b1279e173e6d2..ba1b9cdbe11c1c0bf21d76d26bc529d0eee52b5d 100644 (file)
@@ -5,6 +5,6 @@ IN: io.directories.search.tests
 [ t ] [
     [
         10 [ "io.paths.test" "gogogo" make-unique-file ] replicate
-        current-temporary-directory get [ ] find-all-files
+        current-temporary-directory get [ ] find-all-files
     ] with-unique-directory drop [ natural-sort ] bi@ =
 ] unit-test
index b56fb7b6a3ff2c37fec947c0cad17f4b07cac993..ee8fd129a7313239ce0982d62a89777037b5d6d4 100755 (executable)
@@ -51,7 +51,8 @@ PRIVATE>
         [ keep and ] curry iterate-directory
     ] [ drop f ] recover ; inline
 
-: find-all-files ( path bfs? quot: ( obj -- ? ) -- paths/f )
+: find-all-files ( path quot: ( obj -- ? ) -- paths/f )
+    f swap
     '[
         _ _ _ [ <directory-iterator> ] dip
         pusher [ [ f ] compose iterate-directory drop ] dip
index 755710befd03d4b5ce3379e4fe8a1c49fe2c6d0c..cda94034179cac43e15e5ebb36aecf02c0456a0e 100644 (file)
@@ -7,7 +7,7 @@ IN: io.directories.search.windows
 : program-files-directories ( -- array )
     program-files program-files-x86 2array harvest ; inline
 
-: find-in-program-files ( base-directory bfs? quot -- path )
-    [
+: find-in-program-files ( base-directory quot -- path )
+    t swap [
         [ program-files-directories ] dip '[ _ append-path ] map
     ] 2dip find-in-directories ; inline