emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing.


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing.
Date: Sun, 1 Aug 2021 18:29:32 -0400 (EDT)

branch: elpa/geiser-guile
commit 5e2c87483a4f043377aa38269e26cb9fad969118
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>

    Golfing.
---
 geiser/modules.scm | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/geiser/modules.scm b/geiser/modules.scm
index e59bbd2..6f499dd 100644
--- a/geiser/modules.scm
+++ b/geiser/modules.scm
@@ -66,19 +66,16 @@
   (submodules (resolve-module '() #f)))
 
 (define (all-modules)
-  (define (not-anon m) (not (string-match "^[(]#[{]" m)))
+  (define (maybe-name m)
+    (let ((name (format "~A" (module-name m))))
+      (and (not (string-match "^[(]#[{]" name)) name)))
   (let* ((guile (resolve-module '(guile)))
          (roots (remove (lambda (m) (eq? m guile)) (root-modules))))
     (cons "(guile)"
-          (filter not-anon
-                  (apply append
-                         (map (lambda (r)
-                                (map (lambda (m)
-                                       (format "~A" (module-name m)))
-                                     (all-child-modules r '())))
-                              roots))))))
-
-(define (all-child-modules mod seen)
+          (filter-map maybe-name
+                      (apply append (map all-child-modules roots))))))
+
+(define* (all-child-modules mod #:optional (seen '()))
   (let ((cs (filter (lambda (m) (not (member m seen))) (submodules mod))))
     (fold (lambda (m all) (append (all-child-modules m all) all))
           (list mod)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]