summaryrefslogtreecommitdiff
path: root/scheme/plt/geiser/locations.ss
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/plt/geiser/locations.ss')
-rw-r--r--scheme/plt/geiser/locations.ss13
1 files changed, 10 insertions, 3 deletions
diff --git a/scheme/plt/geiser/locations.ss b/scheme/plt/geiser/locations.ss
index 80040f9..1b13e8f 100644
--- a/scheme/plt/geiser/locations.ss
+++ b/scheme/plt/geiser/locations.ss
@@ -26,16 +26,23 @@
#lang scheme
-(provide symbol-location)
+(provide symbol-location
+ symbol-module-path-name
+ symbol->module-name)
-(define (%symbol-location sym)
+(require geiser/utils)
+
+(define (symbol-module-path-name sym)
(let ([binding (identifier-binding sym)])
(and (list? binding)
(resolved-module-path-name
(module-path-index-resolve (car binding))))))
(define (symbol-location sym)
- (let ((file (%symbol-location (namespace-symbol->identifier sym))))
+ (let ((file (symbol-module-path-name (namespace-symbol->identifier sym))))
(list (cons 'file (if (path? file) (path->string file) '())))))
+(define symbol->module-name
+ (compose module-path-name->name symbol-module-path-name))
+
;;; locations.ss ends here