[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 3bb2a98 006/284: Don't let (ice-9 history) co
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 3bb2a98 006/284: Don't let (ice-9 history) confuse the evaluator. |
Date: |
Sun, 1 Aug 2021 18:29:05 -0400 (EDT) |
branch: elpa/geiser-guile
commit 3bb2a98e05b21cfd44aeb766eedb97e84408cc63
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Don't let (ice-9 history) confuse the evaluator.
---
geiser/introspection.scm | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/geiser/introspection.scm b/geiser/introspection.scm
index eb5dc6c..6ac3f69 100644
--- a/geiser/introspection.scm
+++ b/geiser/introspection.scm
@@ -30,15 +30,17 @@
#:use-module (ice-9 session)
#:use-module (srfi srfi-1))
-(define (proc-args proc)
- (let ((proc (and (symbol? proc)
- (module-bound? (current-module) proc)
- (eval proc (current-module)))))
- (cond ((not proc) #f)
- ((program? proc) (program-args proc))
- ((procedure? proc) (procedure-args proc))
- ((macro? proc) (macro-args proc))
- (else #f))))
+(define (resolve-symbol sym)
+ (and (symbol? sym)
+ (module-bound? (current-module) sym)
+ (eval sym (current-module))))
+
+(define (obj-args obj)
+ (cond ((not obj) #f)
+ ((program? obj) (program-args obj))
+ ((procedure? obj) (procedure-args obj))
+ ((macro? obj) (macro-args obj))
+ (else #f)))
(define (program-args program)
(let* ((arity (program-arity program))
@@ -61,10 +63,9 @@
(and (not (null? env)) env))))
(define (macro-args macro)
- ;; check if return value is a procedure
(let ((prog (macro-transformer macro)))
(if prog
- (program-args prog)
+ (obj-args prog)
(format-args '(...) #f #f))))
(define (format-args args opt module)
@@ -72,9 +73,17 @@
(cons 'optional (or opt '()))
(cons 'module (if module (module-name module) '()))))
+(define (proc-args proc)
+ (obj-args (resolve-symbol proc)))
+
(define (completions prefix)
(sort! (map symbol->string
(apropos-internal (string-append "^" prefix)))
string<?))
+(define (proc-location proc)
+ (let ((prog (resolve-symbol proc)))
+ (and prog
+ (program-source ))))
+
;;; introspection.scm ends here
- [nongnu] branch elpa/geiser-guile created (now 8dda28f), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3bb2a98 006/284: Don't let (ice-9 history) confuse the evaluator.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile 849fc5f 002/284: Compile file., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3fa6b34 004/284: Load file commands., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 1b60c6f 003/284: * scheme/guile/geiser/eval.scm: missing file in previous commit, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 475fab3 005/284: README stuff., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7d50479 001/284: Guile scheme files moved to scheme/guile., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b20a784 010/284: Better arg lists., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b853bac 009/284: Faster M-., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9ff1f7e 033/284: Eval/load file in the correct module., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 441cc2a 037/284: Refactoring: local bindings discovery moved to schemeland., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ceca3e5 038/284: Display (quote foo) as 'foo in autodoc strings., Philip Kaludercic, 2021/08/01