From e56277b22d668b6b46222d89054cc4842a1c0239 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 15 May 2009 13:42:41 +0200 Subject: PLT: Bug fix: correctly handle explicit module definitions. --- scheme/plt/geiser/modules.ss | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'scheme/plt') diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss index a1094af..142cf1e 100644 --- a/scheme/plt/geiser/modules.ss +++ b/scheme/plt/geiser/modules.ss @@ -40,14 +40,18 @@ ((absolute-path? spec) `(file ,spec)) (else spec))) -(define (module-spec->namespace mod-spec) - (letrec ((spec (ensure-module-spec mod-spec)) - (handler (lambda (e) - (load-module spec) - (enter! #f) - (module->namespace spec)))) +(define (module-spec->namespace spec) + (let* ((spec (ensure-module-spec spec)) + (contract-handler (lambda (e) + (load-module spec) + (enter! #f) + (module->namespace spec))) + (filesystem-handler (lambda (e) + (when (symbol? spec) + (module->namespace `',spec))))) (if spec - (with-handlers ((exn:fail:contract? handler)) + (with-handlers ((exn:fail:contract? contract-handler) + (exn:fail:filesystem? filesystem-handler)) (module->namespace spec)) (current-namespace)))) -- cgit v1.2.3