     [ prepend-path ] { } assoc>map
     [ executable? ] find nip ;
 
-: (which) ( command paths -- file/f )
+: (which) ( command path -- file/f )
     split-path os windows? [
         [ path-extensions ] [ "." prefix ] bi*
     ] [ [ 1array ] dip ] if ((which)) ;

PRIVATE>

: which ( command -- file/f )
    current-path (which) ;


<PRIVATE

: executable? ( path -- ? )
    {
        [ exists? ]
        [ file-executable? ]
        [ file-info directory? not ]
    } 1&& ;

: split-path ( paths -- seq )
    os windows? ";" ":" ? split harvest ;

: path-extensions ( command -- commands )
    "PATHEXT" os-env [
