diff --git a/collects/drscheme/private/module-language.ss b/collects/drscheme/private/module-language.ss index 7827461846..9e8871caab 100644 --- a/collects/drscheme/private/module-language.ss +++ b/collects/drscheme/private/module-language.ss @@ -158,7 +158,10 @@ "there can only be one expression in the definitions window" super-result)))] [(= 4 iteration-number) - #`(eval '(current-namespace (module->namespace '#,(get-full-module-name))))] + #`(eval #,#`(#%app current-namespace + (#%app + module->namespace + '#,(get-full-module-name))))] [else eof])))) ;; printer settings are just ignored here. @@ -405,18 +408,7 @@ (check-filename-matches filename (syntax-object->datum (syntax name)) unexpanded-stx)) - - - (values v-name - stx) - - ;; this isn't working ... - #; - (let ([new-name (if filename - (build-name filename) - v-name)]) - (values new-name - #`(module #,new-name lang (#%plain-module-begin bodies ...)))))] + (values v-name stx))] [else (raise-syntax-error 'module-language "only module expressions are allowed" diff --git a/collects/tests/drscheme/module-lang-test.ss b/collects/tests/drscheme/module-lang-test.ss index fc6297b00c..f2c04cc32a 100644 --- a/collects/tests/drscheme/module-lang-test.ss +++ b/collects/tests/drscheme/module-lang-test.ss @@ -17,7 +17,6 @@ (define tests (list - (make-test "" #f (regexp "module-language: the definitions window must contain a module")) @@ -103,7 +102,21 @@ (provide s) (define-syntax (s stx) e))) (format "~s ~s" '(require m) 's) - ". module-lang-test-tmp2.ss:1:70: compile: bad syntax; literal data is not allowed, because no #%datum syntax transformer is bound in: 1"))) + #rx"module-lang-test-tmp2.ss:1:70: compile: bad syntax; literal data is not allowed, because no #%datum syntax transformer is bound in: 1$") + + (make-test (format "~s" + '(module tmp mzscheme + (provide (rename app #%app) + (rename -current-namespace current-namespace) + (rename -module->namespace module->namespace)) + (define x 2) + (define -current-namespace error) + (define -module->namespace error) + (define-syntax app + (syntax-rules () + ((app . x) '(app . x)))))) + "x" + "2"))) ;; set up for tests that need external files (call-with-output-file (build-path this-dir "module-lang-test-tmp.ss")