From 0d7c3c52912abb92e7f03c3fcff00f9e5d570942 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 1 Jun 2015 14:26:38 -0700 Subject: [PATCH] io.standard-paths: add ?find-in-path. --- basis/io/standard-paths/standard-paths.factor | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/basis/io/standard-paths/standard-paths.factor b/basis/io/standard-paths/standard-paths.factor index e2ba2333f1..5aac58a1fe 100644 --- a/basis/io/standard-paths/standard-paths.factor +++ b/basis/io/standard-paths/standard-paths.factor @@ -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" ] }