From e4485d1e11e05ea150958a08be9a2a743ba09783 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 25 May 2020 07:49:15 -0600 Subject: [PATCH] doc: more notes on `dynamic-require` examples Suggested by Shriram. --- .../scribblings/reference/module-reflect.scrbl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/module-reflect.scrbl b/pkgs/racket-doc/scribblings/reference/module-reflect.scrbl index 862c5c3f4f..c06ae1f159 100644 --- a/pkgs/racket-doc/scribblings/reference/module-reflect.scrbl +++ b/pkgs/racket-doc/scribblings/reference/module-reflect.scrbl @@ -544,10 +544,16 @@ above the @tech{base phase}. (dynamic-require ''a #f) ] -@margin-note{The double quoted @racket[''a] evaluates to the @racket[root-module-path] @racket['a] -(see the grammar for @racket[require]). Using @racket['a] or @racket[a] for @racket[mod] won't work -because the former evaluates to @racket[root-module-path] @racket[a] which fails since the example is -not a module installed in a collection, the latter is an undefined variable.} +@margin-note{The double quoted @racket[''a] evaluates to the @racket[_root-module-path] @racket['a] +(see the grammar for @racket[require]). Using @racket['a] for @racket[mod] won't work, +because that evaluates to @racket[_root-module-path] @racket[a], and the example is +not a module installed in a collection. Using @racket[a] won't work, because @racket[a] +is an undefined variable. + +Declaring @racket[(module a ....)] within another module, instead of in +the @racket[read-eval-print] loop, would create a submodule. In that case, +@racket[(dynamic-require ''a #f)] would not access the module, because @racket[''a] +does not refer to a submodule.} When @racket[provided] is a symbol, the value of the module's export with the given name is returned, and still the module is not