[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile f36778f 059/284: Some tidy up.
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile f36778f 059/284: Some tidy up. |
Date: |
Sun, 1 Aug 2021 18:29:15 -0400 (EDT) |
branch: elpa/geiser-guile
commit f36778f5367d73a519b56f48a79875a424db35fe
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Some tidy up.
---
geiser/doc.scm | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/geiser/doc.scm b/geiser/doc.scm
index a58f1d9..b128434 100644
--- a/geiser/doc.scm
+++ b/geiser/doc.scm
@@ -37,34 +37,27 @@
#:use-module (oop goops)
#:use-module (srfi srfi-1))
-(define placeholder (gensym))
-
(define (autodoc form)
- (cond ((or (eq? form placeholder) (null? form)) #f)
+ (cond ((null? form) #f)
((symbol? form) (describe-application (list form)))
((not (pair? form)) #f)
((not (list? form)) (autodoc (pair->list form)))
((define-head? form) => autodoc)
- (else
- (let ((lst (last form)))
- (cond ((and (symbol? lst) (describe-application (list lst))))
- ((and (pair? lst) (not (memq (car lst) '(quote))) (autodoc
lst)))
- ((pair? lst) (autodoc (flatten-last form)))
- (else (describe-application form)))))))
+ (else (autodoc/list form))))
-(define (flatten-last form)
- (reverse! (cons placeholder (cdr (reverse! form)))))
+(define (autodoc/list form)
+ (let ((lst (last form)))
+ (cond ((and (symbol? lst) (describe-application (list lst))))
+ ((and (pair? lst) (not (memq (car lst) '(quote))) (autodoc lst)))
+ (else (describe-application form)))))
(define (define-head? form)
- (define def-heads '(define define* define-macro define-macro* define-method))
+ (define defforms '(define define* define-macro define-macro*
+ define-method define-class define-generic))
(and (= 2 (length form))
- (memq (car form) def-heads)
+ (memq (car form) defforms)
(car form)))
-(define (object-signature name obj)
- (let ((args (obj-args obj)))
- (and args (signature name args))))
-
(define (describe-application form)
(let* ((fun (car form))
(args (obj-args (symbol->object fun))))
@@ -73,11 +66,9 @@
(cons 'position (find-position args form))
(cons 'module (symbol-module fun))))))
-(define (arglst args kind)
- (let ((args (assq-ref args kind)))
- (cond ((or (not args) (null? args)) '())
- ((list? args) args)
- (else (list args)))))
+(define (object-signature name obj)
+ (let ((args (obj-args obj)))
+ (and args (signature name args))))
(define (signature fun args)
(let ((req (arglst args 'required))
@@ -111,6 +102,12 @@
(if (null? keys) 0 (+ 1 (length keys)))
(if rest 2 0))))))))
+(define (arglst args kind)
+ (let ((args (assq-ref args kind)))
+ (cond ((or (not args) (null? args)) '())
+ ((list? args) args)
+ (else (list args)))))
+
(define (obj-args obj)
(cond ((not obj) #f)
((or (procedure? obj) (program? obj)) (arguments obj))
- [nongnu] elpa/geiser-guile 943e58b 039/284: Miscellaneous little fixes., (continued)
- [nongnu] elpa/geiser-guile 943e58b 039/284: Miscellaneous little fixes., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 717f3d0 040/284: Fix for autodoc when point in a rest formal arg in define., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ea9e341 041/284: Bug fix., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile acde425 043/284: Macro-expand commands., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7fcb4ea 047/284: Autodoc enhancements:, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile eeda11c 050/284: Leave quasiquote alone in autodoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile af8296f 051/284: generic-methods implemented in scheme (no emacs side yet)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ea52102 055/284: A bit more robust generic methods., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c3d36f3 056/284: Don't display autodoc for function being defined., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d5ff699 057/284: Refactoring., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f36778f 059/284: Some tidy up.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile c52771f 062/284: Support for multiple Scheme implementations, Chapter 2., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e912bbf 063/284: Multiple values as evaluation result supported., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 38da2b3 064/284: Misc nits and work in progress., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ce78e11 069/284: Better xref display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4eeb068 071/284: Module completion generalized and implemented for PLT., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 63ebbc1 070/284: Using the new (system xref) interface., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 54484ab 075/284: Fixes for module names reading and evaluation result display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b14ac49 079/284: Guile: rewriting stack trace captures - not yet complete., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b32aed7 077/284: module-children -> module-exports., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 19f55b0 097/284: New implementation registration mechanism, for the elisp side of things., Philip Kaludercic, 2021/08/01