From fc74fa36ef2d30b88554033a909a03a56dc2569e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 2 Jun 2014 20:12:00 +0100 Subject: [PATCH] change `collection-file-path` to check for compiled by default for ".rkt" --- .../racket-doc/scribblings/reference/collects.scrbl | 6 ++++-- racket/collects/racket/private/pre-base.rkt | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/reference/collects.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/reference/collects.scrbl index 80897a79d9..89aa10bead 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/reference/collects.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/reference/collects.scrbl @@ -249,11 +249,13 @@ initialized @racket[current-library-collection-links], as follows: @defproc*[([(collection-file-path [file path-string?] [collection path-string?] ...+ - [#:check-compiled? check-compiled? any/c #f]) + [#:check-compiled? check-compiled? any/c + (regexp-match? #rx"[.]rkt$" file)]) path?] [(collection-file-path [file path-string?] [collection path-string?] ...+ [#:fail fail-proc (string? . -> . any)] - [#:check-compiled? check-compiled? any/c #f]) + [#:check-compiled? check-compiled? any/c + (regexp-match? #rx"[.]rkt$" file)]) any])]{ Returns the path to the file indicated by @racket[file] in the diff --git a/racket/collects/racket/private/pre-base.rkt b/racket/collects/racket/private/pre-base.rkt index 264cbd3313..cb913ae63d 100644 --- a/racket/collects/racket/private/pre-base.rkt +++ b/racket/collects/racket/private/pre-base.rkt @@ -112,7 +112,9 @@ (define-values (new:collection-file-path) (let ([collection-file-path (new-lambda (file-name collection - #:check-compiled? [check-compiled? #f] + #:check-compiled? [check-compiled? + (and (path-string? file-name) + (regexp-match? #rx"[.]rkt$" file-name))] #:fail [fail (lambda (s) (raise (exn:fail:filesystem