summaryrefslogtreecommitdiff
path: root/scheme/racket
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-07-28 01:08:25 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-07-28 01:08:25 +0200
commit32f9cb274bc9abc16449d2da50df537c82cc7775 (patch)
tree70bdaee986544bb0ea5978bc33cbed47957fc003 /scheme/racket
parent235543503d09a52a513054ed75ac2506b7ce87bf (diff)
downloadgeiser-chez-32f9cb274bc9abc16449d2da50df537c82cc7775.tar.gz
geiser-chez-32f9cb274bc9abc16449d2da50df537c82cc7775.tar.bz2
Displaying variable values in autodoc.
Diffstat (limited to 'scheme/racket')
-rw-r--r--scheme/racket/geiser/autodoc.rkt9
1 files changed, 6 insertions, 3 deletions
diff --git a/scheme/racket/geiser/autodoc.rkt b/scheme/racket/geiser/autodoc.rkt
index 9eb732d..9eaec15 100644
--- a/scheme/racket/geiser/autodoc.rkt
+++ b/scheme/racket/geiser/autodoc.rkt
@@ -26,17 +26,20 @@
(map (lambda (id) (or (autodoc* id) (list id))) ids)))
(define (autodoc* id)
+ (define (val)
+ (with-handlers ([exn? (const "")])
+ (format "~.a" (namespace-variable-value id))))
(and
(symbol? id)
(let* ([loc (symbol-location* id)]
[name (car loc)]
[path (cdr loc)]
- [sgns (and path (find-signatures path name id))]
- [sgns (and sgns (if (list? sgns) sgns '()))])
+ [sgns (and path (find-signatures path name id))])
(and sgns
`(,id
(name . ,name)
- (args ,@(map format-signature sgns))
+ (value . ,(if (list? sgns) "" (val)))
+ (args ,@(if (list? sgns) (map format-signature sgns) '()))
(module . ,(module-path-name->name path)))))))
(define (format-signature sign)