diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-17 02:49:19 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-17 02:49:19 +0200 |
commit | 99355e34b3e4eeb667692f8d3ae559e672ed45c7 (patch) | |
tree | 14c6761fa73729f5c8ef05770332ad75caa7371a | |
parent | a4ae1d6901d397ad740141dddbd9144c04681586 (diff) | |
download | geiser-guile-99355e34b3e4eeb667692f8d3ae559e672ed45c7.tar.gz geiser-guile-99355e34b3e4eeb667692f8d3ae559e672ed45c7.tar.bz2 |
Wee refactoring.
-rw-r--r-- | scheme/racket/geiser/autodoc.rkt | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/scheme/racket/geiser/autodoc.rkt b/scheme/racket/geiser/autodoc.rkt index a62bc24..9eb732d 100644 --- a/scheme/racket/geiser/autodoc.rkt +++ b/scheme/racket/geiser/autodoc.rkt @@ -147,17 +147,12 @@ [else (loop (cdr formals) (cons (car formals) req) opt keys)]))) (define (infer-signatures name) - (define syntax-tag (cons 1 0)) - (define error-tag (cons 1 1)) - (define generic-signature (signature '(...) '() '() #f)) - (let ([value (with-handlers ([exn:fail:syntax? (lambda (_) syntax-tag)] - [exn:fail:contract:variable? (lambda (_) - error-tag)]) - (namespace-variable-value name))]) - (cond [(procedure? value) (arity->signatures (procedure-arity value))] - [(eq? value syntax-tag) (list generic-signature)] - [(eq? value error-tag) #f] - [else 'variable]))) + (with-handlers ([exn:fail:syntax? (const `(,(signature '(...) '() '() #f)))] + [exn:fail:contract:variable? (const #f)]) + (let ([v (namespace-variable-value name)]) + (if (procedure? v) + (arity->signatures (procedure-arity v)) + 'variable)))) (define (arity->signatures arity) (define (args count) (build-list count (const '_))) |