From 9a6f0303a54aa3c687e63f03e83cae63d4c8e5ce Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 27 Mar 2010 15:45:14 +0100 Subject: PLT: some simplifications. --- scheme/plt/geiser/modules.ss | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'scheme/plt') 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)))) -- cgit v1.2.3