Liliana Marie Prikler <liliana.prik...@gmail.com> writes: > I think the most general definition that's still useful is this > > (define* (search-input-file* inputs predicate > #:key (hint "<unknown>")) > "Find the first file in INPUTS matching PREDICATE. The return value > of PREDICATE is returned as-is, so patterns like > (search-input-file* inputs > (lambda (parent) > (and (file-exists? (string-append parent \"/lib/foobar.so\")) > (string-append parent \"/lib\")))) > work as expected. > > When PREDICATE returns no match, raise a search error using HINT for a > file name." > (match inputs > (((_ . directories) ...) > (or (any predicate directories) > (raise (condition > (&search-error (path directories) > (file hint))))))))
You're right; this is better. -- (