summaryrefslogtreecommitdiff
path: root/scheme
diff options
context:
space:
mode:
Diffstat (limited to 'scheme')
-rw-r--r--scheme/guile/geiser/doc.scm7
-rw-r--r--scheme/racket/geiser/autodoc.rkt9
2 files changed, 11 insertions, 5 deletions
diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm
index 8c00e22..0d6b451 100644
--- a/scheme/guile/geiser/doc.scm
+++ b/scheme/guile/geiser/doc.scm
@@ -49,8 +49,11 @@
,@(let ((rest (assq-ref as 'rest)))
(if rest (list "...") '())))
(key ,@(arglst as 'keyword))))
- (let ((args-list (map mkargs (if (list? args-list) args-list '()))))
- (list id (cons 'args args-list))))
+ (let* ((args-list (map mkargs (if (list? args-list) args-list '())))
+ (value (if (null? args-list)
+ (format #f "~s" (symbol->object id))
+ "")))
+ (list id (cons 'args args-list) (cons 'value value))))
(define default-macro-args '(((required ...))))
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)