From: John Benediktsson Date: Mon, 1 Jun 2015 16:11:19 +0000 (-0700) Subject: tools.which: add a convenience for "which or". X-Git-Tag: unmaintained~2708 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=de9094b8d56edf72c640782d76410393851ec8ba tools.which: add a convenience for "which or". --- diff --git a/extra/tools/which/which.factor b/extra/tools/which/which.factor index 68e230b637..52293a264f 100644 --- a/extra/tools/which/which.factor +++ b/extra/tools/which/which.factor @@ -41,6 +41,9 @@ PRIVATE> : which ( command -- file/f ) "PATH" os-env (which) ; +: ?which ( command -- file/command ) + [ which ] [ or ] bi ; + : run-which ( -- ) command-line get [ which [ print ] when* ] each ;