[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chez e80f797a5c 10/15: autodoc: fix for arity 0 fun
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/geiser-chez e80f797a5c 10/15: autodoc: fix for arity 0 functions |
Date: |
Tue, 11 Oct 2022 13:58:55 -0400 (EDT) |
branch: elpa/geiser-chez
commit e80f797a5c8e3b5ea647fb74194fea161df0550b
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
autodoc: fix for arity 0 functions
---
src/geiser/geiser.ss | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/geiser/geiser.ss b/src/geiser/geiser.ss
index dae82c00eb..04fbca8190 100644
--- a/src/geiser/geiser.ss
+++ b/src/geiser/geiser.ss
@@ -74,6 +74,14 @@
(map write-to-string
(environment-symbols (interaction-environment))))))
+ (define not-found (gensym))
+
+ (define (try-eval sym . env)
+ (call/cc
+ (lambda (k)
+ (with-exception-handler (lambda (e) (k not-found))
+ (lambda () (if (null? env) (eval sym) (eval sym (car env))))))))
+
(define (geiser:eval module form)
(call-with-result
(lambda () (if module (eval form (environment module)) (eval form)))))
@@ -137,14 +145,6 @@
(l (string-length s)))
(if (<= l max-len) s (string-append (substring s 0 sub-len) sub-str))))
- (define not-found (gensym))
-
- (define (try-eval sym)
- (call/cc
- (lambda (k)
- (with-exception-handler (lambda (e) (k not-found))
- (lambda () (eval sym))))))
-
(define (operator-arglist operator)
(define (procedure-parameter-list p)
(and (procedure? p)
@@ -159,9 +159,10 @@
(let ([binding (try-eval operator)])
(if (not (eq? binding not-found))
(let ([arglists (procedure-parameter-list binding)])
- (if arglists
- `(,operator ("args" ,@(map autodoc-arglist arglists)))
- `(,operator ("value" . ,(value->string binding)))))
+ (cond ((null? arglists) `(,operator ("args" (("required")))))
+ (arglists
+ `(,operator ("args" ,@(map autodoc-arglist arglists))))
+ (else `(,operator ("value" . ,(value->string binding))))))
'())))
(define (geiser:autodoc ids)
- [nongnu] elpa/geiser-chez updated (48427d4aec -> 53b7279550), ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez db4d645996 01/15: better display of evaluation results (dups, spurious compile msgs), ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 52fbf028e5 04/15: fixes for the above in the face of non-continuable conditions, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez e80f797a5c 10/15: autodoc: fix for arity 0 functions,
ELPA Syncer <=
- [nongnu] elpa/geiser-chez 3bfa85afb9 05/15: following the error reporting protocol now that geiser does too, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 7f12bcfe8b 13/15: initial implementation of symbol-location and module-location, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 00ab1e6c7a 12/15: 'module' recognised as a keyword in chez, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 3996898343 14/15: add-to-load-path, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 2d8cd83c64 08/15: wee refactoring, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 501fa22da4 06/15: whitespace and spurious rest arg, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez a70c47c557 07/15: unit test fixes, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 21d35aa8d6 02/15: autodoc improvements (signatures from arities, values), ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 0cd37833ab 03/15: geiser-chez-debug-on-exception-p -> geiser-chez-debug-on-exception, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 39b7e9357d 09/15: remote connections: wee refactoring, ELPA Syncer, 2022/10/11