* module/ice-9/session.scm (submodules): replace implementation to
  use `module-submodules' instead of `module-obarray' (the latter
  doesn't include submodules anymore).

Signed-off-by: Jose A. Ortega Ruiz <j...@gnu.org>
---
 module/ice-9/session.scm |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/module/ice-9/session.scm b/module/ice-9/session.scm
index 10ce613..36aeb99 100644
--- a/module/ice-9/session.scm
+++ b/module/ice-9/session.scm
@@ -406,15 +406,8 @@ It is an image under the mapping EXTRACT."
 (define (root-modules)
   (submodules (resolve-module '() #f)))
 
-(define (submodules m)
-  (hash-fold (lambda (name var data)
-              (let ((obj (and (variable-bound? var) (variable-ref var))))
-                (if (and (module? obj)
-                         (eq? (module-kind obj) 'directory))
-                    (cons obj data)
-                    data)))
-            '()
-            (module-obarray m)))
+(define (submodules mod)
+  (hash-map->list (lambda (k v) v) (module-submodules mod)))
 
 (define apropos-fold-exported
   (make-fold-modules root-modules submodules module-public-interface))
-- 
1.7.1


Reply via email to