summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-05 06:40:05 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-04-05 06:40:05 +0200
commit63ebbc1c5343be09167f84090cf9cf69bb8e776a (patch)
tree45fe107bf988da7a0a4d00c2f4ec43be6c3e7707
parentce78e11bd6438311611dcbae6140ebc10c68d84c (diff)
downloadgeiser-guile-63ebbc1c5343be09167f84090cf9cf69bb8e776a.tar.gz
geiser-guile-63ebbc1c5343be09167f84090cf9cf69bb8e776a.tar.bz2
Using the new (system xref) interface.
-rw-r--r--geiser/xref.scm19
1 files changed, 14 insertions, 5 deletions
diff --git a/geiser/xref.scm b/geiser/xref.scm
index 059fbb0..f00f724 100644
--- a/geiser/xref.scm
+++ b/geiser/xref.scm
@@ -42,7 +42,9 @@
(define (generic-methods sym)
(let* ((gen (symbol->object sym))
- (methods (if (is-a? gen <generic>) (generic-function-methods gen) '())))
+ (methods (if (is-a? gen <generic>)
+ (generic-function-methods gen)
+ '())))
(filter (lambda (x) (not (null? x)))
(map (lambda (m)
(make-xref (method-procedure m) sym (symbol-module sym)))
@@ -67,14 +69,21 @@
(name (and mod (module-name mod))))
(and name (module-filename name))))
-(define (procedure-xref proc)
- (let ((name (procedure-name proc)))
- (make-xref proc name (symbol-module name))))
+(define (procedure-xref proc . mod-name)
+ (let ((proc-name (or (procedure-name proc) '<anonymous>))
+ (mod-name (if (null? mod-name)
+ (symbol-module name)
+ (car mod-name))))
+ (make-xref proc proc-name mod-name)))
(define (callers sym)
(let ((mod (symbol-module sym #t)))
(and mod
- (map procedure-xref (procedure-callers (cons mod sym))))))
+ (apply append (map (lambda (procs)
+ (map (lambda (proc)
+ (procedure-xref proc (car procs)))
+ (cdr procs)))
+ (procedure-callers (cons mod sym)))))))
(define (callees sym)
(let ((obj (symbol->object sym)))