]> gitweb.factorcode.org Git - factor.git/commitdiff
io.standard-paths: add ?find-in-path.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 1 Jun 2015 21:26:38 +0000 (14:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 1 Jun 2015 21:26:38 +0000 (14:26 -0700)
basis/io/standard-paths/standard-paths.factor

index e2ba2333f13d0d39217ad46502548cb3e44486a3..5aac58a1fe1cc79ec8916029cbbd2fad4dbf9e7d 100644 (file)
@@ -11,9 +11,13 @@ HOOK: find-in-path* os ( string -- path/f )
 HOOK: find-in-applications os ( directories filename -- path )
 
 : find-in-path ( string -- path/f )
-    [ f ]
-    [ [ find-in-path* ] keep over [ append-path ] [ 2drop f ] if ]
-    if-empty ;
+    [ f ] [
+        [ find-in-path* ] keep over
+        [ append-path ] [ 2drop f ] if
+    ] if-empty ;
+
+: ?find-in-path ( string -- path/string )
+    [ find-in-path ] [ or ] bi ;
 
 {
     { [ os windows? ] [ "io.standard-paths.windows" ] }