diff options
-rw-r--r-- | scheme/plt/geiser/modules.ss | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss index 9bdede1..ef6530a 100644 --- a/scheme/plt/geiser/modules.ss +++ b/scheme/plt/geiser/modules.ss @@ -28,19 +28,14 @@ (else `(file ,spec)))) (define (module-spec->namespace spec (lang #f)) - (let* ((spec (ensure-module-spec spec)) - (try-lang (lambda (e) - (if (symbol? lang) - (begin - (load-module lang #f (current-namespace)) - (module->namespace lang)) - (current-namespace)))) - (filesystem-handler (lambda (e) - (with-handlers ((exn? try-lang)) - (module->namespace `',spec))))) + (let ((spec (ensure-module-spec spec))) (if spec - (with-handlers ((exn:fail:filesystem? filesystem-handler) - (exn? try-lang)) + (with-handlers ((exn? + (lambda (_) + (with-handlers + ((exn? (const (current-namespace)))) + (load-module lang #f (current-namespace)) + (module->namespace lang))))) (module->namespace spec)) (current-namespace)))) |