From 6ff99367a56fc4ee6b8f9d3ab9906efc45d91937 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Thu, 5 Mar 2009 02:19:42 +0100 Subject: They say call/cc is slow in Guile. --- geiser/modules.scm | 17 ++++++++++------- 1 file 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)) -- cgit v1.2.3