summaryrefslogtreecommitdiff
path: root/geiser/modules.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-05 02:19:42 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-05 02:19:42 +0100
commit6ff99367a56fc4ee6b8f9d3ab9906efc45d91937 (patch)
treef3d79a4971d7f90c32cf9bce77aa3059367210ab /geiser/modules.scm
parentaf8296f04700d0b0c2ba16cc4fd91ecae0256477 (diff)
downloadgeiser-guile-6ff99367a56fc4ee6b8f9d3ab9906efc45d91937.tar.gz
geiser-guile-6ff99367a56fc4ee6b8f9d3ab9906efc45d91937.tar.bz2
They say call/cc is slow in Guile.
Diffstat (limited to 'geiser/modules.scm')
-rw-r--r--geiser/modules.scm17
1 files changed, 10 insertions, 7 deletions
diff --git a/geiser/modules.scm b/geiser/modules.scm
index 13a1cdd..0afb8fd 100644
--- a/geiser/modules.scm
+++ b/geiser/modules.scm
@@ -37,13 +37,16 @@
(define (symbol-module sym)
(and sym
- (call/cc
- (lambda (k)
- (apropos-fold (lambda (module name var init)
- (if (eq? name sym) (k (module-name module)) init))
- #f
- (regexp-quote (symbol->string sym))
- (apropos-fold-accessible (current-module)))))))
+ (catch 'module-name
+ (lambda ()
+ (apropos-fold (lambda (module name var init)
+ (if (eq? name sym)
+ (throw 'module-name (module-name module)) init))
+ #f
+ (regexp-quote (symbol->string sym))
+ (apropos-fold-accessible (current-module))))
+ (lambda (key . args)
+ (and (eq? key 'module-name) (car args))))))
(define (module-location name)
(make-location (module-filename name) #f))