[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gambit 9cc9b98 09/34: fix #1 ##decompile now tried
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gambit 9cc9b98 09/34: fix #1 ##decompile now tried before using the procedure's list |
Date: |
Sun, 1 Aug 2021 18:27:16 -0400 (EDT) |
branch: elpa/geiser-gambit
commit 9cc9b98379364538307347656b22f090c2baa50c
Author: mathieu2em <math.per@hotmail.com>
Commit: mathieu2em <math.per@hotmail.com>
fix #1 ##decompile now tried before using the procedure's list
---
scheme/gambit/geiser/gambit.scm | 78 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 77 insertions(+), 1 deletion(-)
diff --git a/scheme/gambit/geiser/gambit.scm b/scheme/gambit/geiser/gambit.scm
index ee3d78a..d8cae00 100644
--- a/scheme/gambit/geiser/gambit.scm
+++ b/scheme/gambit/geiser/gambit.scm
@@ -38,7 +38,83 @@
((not (symbol? (car ids)))
(geiser:autodoc (cdr ids)))
(else
- (list (##procedure-search (car ids))))))
+ (geiser:new-autodoc (car ids)))))
+ ;;(list (##procedure-search (car ids))))))
+
+;; (cadr (##decompile method)) format is
+;;(#!optional (param1 (macro-absent-obj)) (param2 (macro-absent-obj)) #!rest
others)
+;; !! method-name -> procedure
+
+;;
+(define (geiser:new-autodoc method-name)
+ (define (get-required lst)
+ (let loop ((lst lst)
+ (result '()))
+ (cond ((not (pair? lst))
+ ;;(pp (cons (reverse result) '()))
+ ;;(pp "-----NEXT1-- not pair--")
+ (cons (reverse result) '()))
+ ((eq? (car lst) #!optional)
+ ;;(pp (cons (reverse result) (cdr lst)))
+ ;;(pp "-----NEXT1---opt--")
+ (cons (reverse result) (cdr lst)))
+ ((eq? (car lst) #!key)
+ ;;(pp (cons (reverse result) lst))
+ ;;(pp "-----NEXT1--key---")
+ (cons (reverse result) lst))
+ (else (loop (cdr lst) (cons (car lst) result))))))
+
+ (define (get-optional lst)
+ ;;(pp "getopt")
+ ;;(pp lst)
+ ;;(pp "----")
+ (let loop ((lst lst)
+ (result '()))
+ (cond ((or (not (pair? lst))
+ (eq? (car lst) #!key))
+ ;;(pp (cons (reverse result)
+ ;; (if (pair? lst)
+ ;; (cdr lst)
+ ;; '())))
+ ;;(pp "------next2----key or emptylist--")
+ (cons (reverse result)
+ (if (pair? lst)
+ (cdr lst)
+ '())))
+ ((eq? (car lst) #!rest)
+ ;;(pp (cons (reverse (cons '... result)) '()))
+ ;;(pp "-------next2---- rest--")
+ (cons (reverse (cons '... result)) '()))
+ (else
+ (loop (cdr lst) (cons (if (pair? (car lst)) (caar lst) (car lst))
result))))))
+
+ (define (get-key lst)
+ (let loop ((lst lst)
+ (result '()))
+ (cond ((not (pair? lst))
+ result)
+ ((eq? (car lst) #!rest)
+ (reverse (cons '... result)))
+ (else (loop (cdr lst) (cons (car lst) result))))))
+
+
+ (let ((proc (##global-var-ref (##make-global-var method-name))))
+ (if (procedure? proc)
+ (let ((method-tester (##decompile proc)))
+ ;;(pp (cadr method-tester))
+ ;;(pp "---NEXT---")
+ (if (pair? method-tester)
+ (let* ((method (cadr method-tester))
+ (required (get-required method))
+ (optional (get-optional (cdr required)))
+ (key (get-key (cdr optional))))
+ (list `(,method-name
+ ("args" (("required" ,@(car required))
+ ("optional" ,@(car optional))
+ ("key" ,@key)))
+ ("module"))))
+ (list (##procedure-search method-name))))
+ (list (##procedure-search method-name)))))
(define (geiser:module-completions prefix . rest)
(define (environment-symbols)
- [nongnu] elpa/geiser-gambit 52ff341 26/34: license and readme files, (continued)
- [nongnu] elpa/geiser-gambit 52ff341 26/34: license and readme files, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 7867f0a 31/34: installation instructions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 3294c94 34/34: Use new implementation extension declarator, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 0ee4156 33/34: fix: auto-activate implementation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 6bff2b9 08/34: gambit syntax coloration + adjustment of methods list, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 6f01c0d 06/34: parenthesis showing in autodoc fixed., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 95ef42e 03/34: WIP repl behaviour fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 9e6bbd7 01/34: WIP gambit support first draft, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 9be02bc 02/34: prompt regexp, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 56c53d1 17/34: Remove duplicated definition of geiser-connect, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 9cc9b98 09/34: fix #1 ##decompile now tried before using the procedure's list,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gambit c44a145 13/34: better indent , gsi opening param using module if > version 4.9.3, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit a6101d0 14/34: fixes autocompletion problem caused by bad choice of modules inclusion, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 1f1c74c 21/34: Delete trailing whitespace, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 09734f0 20/34: Fix indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 9afb60e 12/34: code cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit f2a5259 18/34: Begin the summary lines of all elisp libraries with three semicolons, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 8f6b060 28/34: Gambit has added the commit guid to the version number. The business logic that deals with gambit version numbers has been updated accordingly, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 4f424f4 25/34: imported files moved to new locations, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit c19162a 27/34: scheme load path adjustments, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gambit 3a169a4 30/34: autoloads and compilation fix, Philip Kaludercic, 2021/08/01