diff --git a/collects/syntax/modcode.rkt b/collects/syntax/modcode.rkt index ec61dd9dbd..10878c0c26 100644 --- a/collects/syntax/modcode.rkt +++ b/collects/syntax/modcode.rkt @@ -193,7 +193,13 @@ [(or (eq? prefer 'src) path-d) (notify path) - (extract-submodule (with-dir (lambda () (compiler (read-one orig-path path #t read-src-syntax)))))] + (define (compile-one) + (with-dir (lambda () (compiler (read-one orig-path path #t read-src-syntax))))) + (if (null? submodule-path) + ;; allow any result: + (compile-one) + ;; expect a compiled-module result: + (extract-submodule (compile-one)))] ;; Report a not-there error [else (raise (make-exn:get-module-code (format "get-module-code: no such file: ~e" orig-path) diff --git a/collects/syntax/scribblings/modcode.scrbl b/collects/syntax/scribblings/modcode.scrbl index e47e656639..da14e4dbd4 100644 --- a/collects/syntax/scribblings/modcode.scrbl +++ b/collects/syntax/scribblings/modcode.scrbl @@ -35,7 +35,8 @@ module. The @racket[compile-proc] argument defaults to @racket[compile]. This procedure is used to compile module source if an already-compiled -version is not available. +version is not available. If @racket[submodule-path] is not @racket['()], +then @racket[compile-proc] must return a compiled module form. The @racket[ext-proc] argument defaults to @racket[#f]. If it is not @racket[#f], it must be a procedure of two arguments that is called