From 2f00de99d0493fdcf8ba41c10c7c3413492f2a78 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 16 Mar 2015 17:27:27 -0600 Subject: [PATCH] declare empty namespace for submodules Using the enclosing module's context for the `#f` part of the `(module* _ #f ....)` would generally enable a compact encoding of bindings for the purposes of `module->namespace`. Disabling `module->namespace` for the generated submodules seems more reliable, and it seems unlikely that anyone will miss the extra debugging capability (which is all that is lost for these submodules whose content is, I think, unspecified). --- typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt | 1 + typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt b/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt index e2c9d1ab..99beef4a 100644 --- a/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt +++ b/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt @@ -100,6 +100,7 @@ (begin-for-syntax (module* #%type-decl #f (#%plain-module-begin ;; avoid top-level printing and config + (#%declare #:empty-namespace) ;; avoid binding info from here (require typed-racket/types/numeric-tower typed-racket/env/type-name-env typed-racket/env/global-env typed-racket/env/type-alias-env typed-racket/types/struct-table typed-racket/types/abbrev diff --git a/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt b/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt index c1c906da..99eec55c 100644 --- a/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt +++ b/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt @@ -407,6 +407,7 @@ (begin-for-syntax (module* #%type-decl #f (#%plain-module-begin ;; avoid top-level printing and config + (#%declare #:empty-namespace) ;; avoid binding info from here (require typed-racket/types/numeric-tower typed-racket/env/type-name-env typed-racket/env/global-env typed-racket/env/type-alias-env typed-racket/types/struct-table typed-racket/types/abbrev @@ -469,8 +470,9 @@ ;; itself) at the runtime of typed modules that don't need ;; them. This is similar to the reason for the ;; `#%type-decl` submodule. - (module* #%contract-defs #f + (module* #%contract-defs #f (#%plain-module-begin + (#%declare #:empty-namespace) ;; avoid binding info from here #,extra-requires new-defs ...))) #`(begin