summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/language/python/compile.scm21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/language/python/compile.scm b/modules/language/python/compile.scm
index 6c46ea1..4c07076 100644
--- a/modules/language/python/compile.scm
+++ b/modules/language/python/compile.scm
@@ -104,17 +104,16 @@
(if (not (equal? val 0))
(format #t "exit with error ~a~%" val))))))
-(define (get-exported-symbols x)
- (aif it (resolve-module x)
- (aif it (module-public-interface it)
- (let ((l '()))
- (module-for-each
- (lambda (k b)
- (set! l (cons k l)))
- it)
- l)
- '())
- '()))
+(define (get-exported-symbols name)
+ "Return a list of exported symbols from the module with the given
+NAME, a list of symbols. If the module does not exist return the
+empty list."
+ (or (and=> (and=> (resolve-module name) module-public-interface)
+ (lambda (interface)
+ (module-map (lambda (name var) name)
+ interface)))
+ '()))
+
(define cvalues (G 'values))