diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-21 01:56:02 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-21 01:56:02 +0100 |
commit | 1d725a8c087b66b2cd2c0e5006c376faf612d6ff (patch) | |
tree | e660e30075c5b03b64da49988683af048eb4f6b0 /scheme/racket/geiser/modules.rkt | |
parent | 481f0ea2e5577ad5bb1a718b8023af92202e7423 (diff) | |
download | geiser-guile-1d725a8c087b66b2cd2c0e5006c376faf612d6ff.tar.gz geiser-guile-1d725a8c087b66b2cd2c0e5006c376faf612d6ff.tar.bz2 |
Better module help
We now display procedure signatures in module help, and keep a cache
in Guile, using procedure properties.
Diffstat (limited to 'scheme/racket/geiser/modules.rkt')
-rw-r--r-- | scheme/racket/geiser/modules.rkt | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/scheme/racket/geiser/modules.rkt b/scheme/racket/geiser/modules.rkt index 0591a92..8e85570 100644 --- a/scheme/racket/geiser/modules.rkt +++ b/scheme/racket/geiser/modules.rkt @@ -18,10 +18,9 @@ namespace->module-path-name module-path-name->name module-spec->path-name - module-list - module-exports) + module-list) -(require srfi/13 syntax/modresolve syntax/modcode geiser/enter) +(require srfi/13 geiser/enter) (define (ensure-module-spec spec) (cond [(symbol? spec) spec] @@ -141,38 +140,8 @@ (update-module-cache) module-cache) -(define (module-exports mod) - (define (value id) - (with-handlers ([exn? (const #f)]) - (dynamic-require mod id (const #f)))) - (define (contracted id) - (let ([v (value id)]) - (if (has-contract? v) - (cons id (contract-name (value-contract v))) - id))) - (define (extract-ids ls) - (append-map (lambda (idls) - (map car (cdr idls))) - ls)) - (define (classify-ids ids) - (let loop ([ids ids] [procs '()] [vars '()]) - (cond [(null? ids) - `((procs ,@(map contracted (reverse procs))) - (vars ,@(map contracted (reverse vars))))] - [(procedure? (value (car ids))) - (loop (cdr ids) (cons (car ids) procs) vars)] - [else (loop (cdr ids) procs (cons (car ids) vars))]))) - (let-values ([(reg syn) - (module-compiled-exports - (get-module-code (resolve-module-path mod #f)))]) - (let ([syn (map contracted (extract-ids syn))] - [reg (extract-ids reg)]) - `((syntax ,@syn) ,@(classify-ids reg))))) - (define (startup) (thread update-module-cache) (void)) (startup) - -;;; modules.rkt ends here |