diff --git a/collects/mzlib/file.rkt b/collects/mzlib/file.rkt index 2a6aa56..944e1b0 100644 --- a/collects/mzlib/file.rkt +++ b/collects/mzlib/file.rkt @@ -39,13 +39,7 @@ (apply build-path p args))) (define (find-library name . cp) - (let ([dir (with-handlers ([exn:fail:filesystem? (lambda (exn) #f)]) - (if (null? cp) - (collection-path "mzlib") - (apply collection-path cp)))]) - (and dir - (let ([file (build-path dir name)]) - (and (file-exists? file) file))))) + (apply collection-file-path name cp)) (define (-call-with-input-file* file thunk . flags) (let ([p (apply mz:open-input-file file flags)]) diff --git a/collects/mzlib/include.rkt b/collects/mzlib/include.rkt index 8050a00..356f326 100644 --- a/collects/mzlib/include.rkt +++ b/collects/mzlib/include.rkt @@ -38,10 +38,11 @@ "`lib' keyword is not followed by a sequence of string datums" stx fn)) - (build-path (if (null? (cdr l)) - (collection-path "mzlib") - (apply collection-path (cdr l))) - (car l)))] + (apply collection-file-path + (car l) + (if (null? (cdr l)) + (list "mzlib") + (cdr l))))] [else (raise-syntax-error #f diff --git a/collects/mzlib/runtime-path.rkt b/collects/mzlib/runtime-path.rkt index 82b87f4..e1ec2f8 100644 --- a/collects/mzlib/runtime-path.rkt +++ b/collects/mzlib/runtime-path.rkt @@ -78,12 +78,13 @@ (let ([s (cadr p)]) (if (regexp-match? #rx"[./]" s) s - (string-append s "/main.rkt"))))] - [dir (if (and (null? (cddr p)) - (null? (cdr strs))) - (collection-path "mzlib") - (apply collection-path (append (cddr p) (drop-right strs 1))))]) - (build-path dir (last strs)))] + (string-append s "/main.rkt"))))]) + (apply collection-file-path + (last strs) + (if (and (null? (cddr p)) + (null? (cdr strs))) + (list "mzlib") + (append (cddr p) (drop-right strs 1)))))] [else (error 'runtime-path "unknown form: ~e" p)]))) paths)))