summaryrefslogtreecommitdiff
path: root/scheme/plt/geiser/modules.ss
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-04-01 02:19:32 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-04-01 02:19:32 +0200
commitd96fe6fc9dbad5d65abe271ceb692f732d53e2fe (patch)
tree3a4ffdb048ad7692c7c79fda5dbd320f05bf5fd8 /scheme/plt/geiser/modules.ss
parent8c47f6099fd05e2feb7cb51e15d39911ef48411d (diff)
downloadgeiser-chez-d96fe6fc9dbad5d65abe271ceb692f732d53e2fe.tar.gz
geiser-chez-d96fe6fc9dbad5d65abe271ceb692f732d53e2fe.tar.bz2
PLT: Major module loading surgery.
This is a dangerous commit. If you use PLT and don't like to live on the edge, just stick with tag 0.0.9 until 0.0.10 is out.
Diffstat (limited to 'scheme/plt/geiser/modules.ss')
-rw-r--r--scheme/plt/geiser/modules.ss21
1 files changed, 10 insertions, 11 deletions
diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss
index 9842174..829cf77 100644
--- a/scheme/plt/geiser/modules.ss
+++ b/scheme/plt/geiser/modules.ss
@@ -20,7 +20,7 @@
module-list
module-exports)
-(require srfi/13 scheme/enter syntax/modresolve syntax/modcode)
+(require srfi/13 syntax/modresolve syntax/modcode geiser/enter)
(define (ensure-module-spec spec)
(cond ((symbol? spec) spec)
@@ -28,22 +28,22 @@
(else `(file ,spec))))
(define (module-spec->namespace spec (lang #f))
- (let ((spec (ensure-module-spec spec)))
- (if spec
- (with-handlers ((exn?
- (lambda (_)
- (with-handlers
- ((exn? (const (current-namespace))))
+ (let ((spec (ensure-module-spec spec))
+ (try-lang (lambda (_)
+ (with-handlers ((exn? (const (current-namespace))))
+ (and lang
+ (begin
(load-module lang #f (current-namespace))
- (module->namespace lang)))))
- (module->namespace spec))
+ (module->namespace lang)))))))
+ (or (and spec
+ (with-handlers ((exn? try-lang)) (get-namespace spec)))
(current-namespace))))
(define nowhere (open-output-nowhere))
(define (load-module spec (port #f) (ns #f))
(parameterize ((current-error-port (or port nowhere)))
- (eval #`(enter! #,(ensure-module-spec spec)))
+ (enter-module (ensure-module-spec spec))
(when (namespace? ns)
(current-namespace ns))))
@@ -79,7 +79,6 @@
((symbol? path) (symbol->string path))
(else "")))
-
(define (skippable-dir? path)
(call-with-values (lambda () (split-path path))
(lambda (_ basename __)