From 18db590dece0f88c3f2bd850a3158bb50605e2c6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 17 Aug 2009 16:23:45 +0200 Subject: Well, i said that it was better, not that it was perfect. Autodoc buglets and support for displaying module variables too. --- scheme/guile/geiser/doc.scm | 16 ++++++++++------ scheme/plt/geiser/autodoc.ss | 6 ++---- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'scheme') diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm index d951f1c..bc4acd9 100644 --- a/scheme/guile/geiser/doc.scm +++ b/scheme/guile/geiser/doc.scm @@ -37,6 +37,8 @@ #:use-module (oop goops) #:use-module (srfi srfi-1)) +(define *an-object* #t) + (define (autodoc ids) (if (not (list? ids)) '() @@ -59,17 +61,19 @@ ((list? args) args) (else (list args))))) `(,id - (required ,@(arglst 'required)) - (optional ,@(arglst 'optional) - ,@(let ((rest (assq-ref args 'rest))) - (if rest (list "...") '()))) - (key ,@(arglst 'keyword)))) + (args ,@(if (list? args) + `((required ,@(arglst 'required)) + (optional ,@(arglst 'optional) + ,@(let ((rest (assq-ref args 'rest))) + (if rest (list "...") '()))) + (key ,@(arglst 'keyword))) + '())))) (define (obj-args obj) (cond ((not obj) #f) ((or (procedure? obj) (program? obj)) (arguments obj)) ((macro? obj) (or (obj-args (macro-transformer obj)) '((required ...)))) - (else #f))) + (else 'variable))) (define (arguments proc) (cond diff --git a/scheme/plt/geiser/autodoc.ss b/scheme/plt/geiser/autodoc.ss index 2fe3a83..c43f8c9 100644 --- a/scheme/plt/geiser/autodoc.ss +++ b/scheme/plt/geiser/autodoc.ss @@ -46,7 +46,7 @@ (and sgn `(,id (name . ,name) - ,@(format-signature sgn) + (args ,@(format-signature sgn)) (module . ,(module-path-name->name path))))))) (define (format-signature sign) @@ -64,9 +64,7 @@ (define (find-signature path name local-name) (let ((path (if (path? path) (path->string path) path))) - (hash-ref! (hash-ref! signatures - path - (lambda () (parse-signatures path))) + (hash-ref! (hash-ref! signatures path (lambda () (parse-signatures path))) name (lambda () (infer-signature local-name))))) -- cgit v1.2.3