() Paul Emsley <[email protected]>
() Wed, 23 Nov 2011 12:16:47 +0000

   What is some-function, where some-function works like this:

   (some-function "ls")
   -> "/bin/ls"  (I'd settle for #t")
   (some-function "asdfasdf")
   -> #f

You can try something like:

(use-modules (srfi srfi-13) (srfi srfi-14))

(define (some-function program)
  (and=> (search-path (string-tokenize (getenv "PATH")
                                       (char-set-complement
                                        (char-set #\:)))
                      program)
         (lambda (filename)
           (and (access? filename X_OK)
                filename))))

Reply via email to