diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-05 02:19:42 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-05 02:19:42 +0100 |
commit | efe21b1337f02095cf40791f8b0c237ae56c39a0 (patch) | |
tree | 89b534d782ad78cb4ef10a1e643b0720382e53b9 /scheme/guile | |
parent | 692eb942c39fd42ffe61f1408a4998d738c88933 (diff) | |
download | geiser-guile-efe21b1337f02095cf40791f8b0c237ae56c39a0.tar.gz geiser-guile-efe21b1337f02095cf40791f8b0c237ae56c39a0.tar.bz2 |
They say call/cc is slow in Guile.
Diffstat (limited to 'scheme/guile')
-rw-r--r-- | scheme/guile/geiser/modules.scm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/scheme/guile/geiser/modules.scm b/scheme/guile/geiser/modules.scm index 13a1cdd..0afb8fd 100644 --- a/scheme/guile/geiser/modules.scm +++ b/scheme/guile/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)) |