summaryrefslogtreecommitdiff
path: root/scheme
diff options
context:
space:
mode:
Diffstat (limited to 'scheme')
-rw-r--r--scheme/plt/geiser/modules.ss22
1 files changed, 16 insertions, 6 deletions
diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss
index ef6530a..9842174 100644
--- a/scheme/plt/geiser/modules.ss
+++ b/scheme/plt/geiser/modules.ss
@@ -108,13 +108,15 @@
(fold-files visit-module-path acc))
acc))
+(define (known-modules)
+ (sort (foldl find-modules '() (current-library-collection-paths)) string<?))
+
(define module-cache #f)
+(define (update-module-cache)
+ (when (not module-cache) (set! module-cache (known-modules))))
(define (module-list)
- (when (not module-cache)
- (set! module-cache
- (sort (foldl find-modules '() (current-library-collection-paths))
- string<?)))
+ (update-module-cache)
module-cache)
(define (module-exports mod)
@@ -124,8 +126,10 @@
ls))
(define (classify-ids ids ns)
(let loop ((ids ids) (procs '()) (vars '()))
- (cond ((null? ids) `((procs ,@(reverse procs)) (vars ,@(reverse vars))))
- ((procedure? (namespace-variable-value (car ids) #t (const #f) ns))
+ (cond ((null? ids)
+ `((procs ,@(reverse procs)) (vars ,@(reverse vars))))
+ ((procedure?
+ (namespace-variable-value (car ids) #t (const #f) ns))
(loop (cdr ids) (cons (car ids) procs) vars))
(else (loop (cdr ids) procs (cons (car ids) vars))))))
(let-values (((reg syn)
@@ -135,4 +139,10 @@
(reg (extract-ids reg)))
`((syntax ,@syn) ,@(classify-ids reg (module-spec->namespace mod))))))
+(define (startup)
+ (thread update-module-cache)
+ (void))
+
+(startup)
+
;;; modules.ss ends here