1(module collect '#%kernel
2  (#%require "qq-and-or.rkt"
3             "path.rkt"
4             "kw.rkt")
5
6  (#%provide new:collection-path
7             new:collection-file-path)
8
9  (define-values (new:collection-path)
10    (let ([collection-path (new-lambda (collection
11                                        #:fail [fail (lambda (s)
12                                                       (raise
13                                                        (exn:fail:filesystem
14                                                         (string-append "collection-path: " s)
15                                                         (current-continuation-marks))))]
16                                        . collections)
17                             (collection-path fail collection collections))])
18      collection-path))
19
20  (define-values (new:collection-file-path)
21    (let ([collection-file-path (new-lambda (file-name
22                                             collection
23                                             #:check-compiled? [check-compiled?
24                                                                (and (path-string? file-name)
25                                                                     (regexp-match? #rx".[.]rkt$" file-name))]
26                                             #:fail [fail (lambda (s)
27                                                            (raise
28                                                             (exn:fail:filesystem
29                                                              (string-append "collection-file-path: " s)
30                                                              (current-continuation-marks))))]
31                                             . collections)
32                                  (collection-file-path fail check-compiled? file-name collection collections))])
33      collection-file-path)))
34