From c76fc748532a6687e210a4d93c85568c606b939f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 10 Jul 2014 13:16:57 +0100 Subject: [PATCH] reference: clarify significance of order for submodules Merge to v6.1 (cherry picked from commit e044e4360b083a1c94c949da53d907f09f394bc7) --- .../racket-doc/scribblings/reference/eval-model.scrbl | 5 +++++ .../racket-doc/scribblings/reference/syntax.scrbl | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/reference/eval-model.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/reference/eval-model.scrbl index 0d4c9f82d3..104e70d0ca 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/reference/eval-model.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/reference/eval-model.scrbl @@ -822,6 +822,11 @@ imports from its enclosing module or vice-versa, then @tech{visits} or @tech{instantiations} of the two modules are independent, and thier implementations may even be loaded from bytecode at different times. +A submodule declared with @racket[module] can import any preceding +submodule declared with @racket[module]. A submodule declared with +@racket[module*] can import any preceding module declared with +@racket[module*] and any submodule declared with @racket[module]. + When a submodule declaration has the form @racket[(module* _name #f ....)], then all of the bindings of the enclosing module's bodies are visible in the submodule's body, and the submodule implicitly imports diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/reference/syntax.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/reference/syntax.scrbl index b9de863531..2c23f8cc41 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/reference/syntax.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/reference/syntax.scrbl @@ -332,7 +332,14 @@ Each addition for @racket[id] is combined in order to form the entire submodule using @racket[(module* id #f ....)] at the end of the enclosing module. If there is only one @racket[module+] for a given @racket[id], then @racket[(module+ id form ...)] is equivalent to -@racket[(module* id #f form ...)]. +@racket[(module* id #f form ...)], but still moved to the end of the +enclosing module. + +When a module contains multiple submodules declared with +@racket[module+], then the relative order of the initial +@racket[module+] declarations for each submodule determines the +relative order of the @racket[module*] declarations at the end of the +enclosing module. A submodule must not be defined using @racket[module+] @emph{and} @racket[module] or @racket[module*]. That is, if a submodule is made