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

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

[elpa] externals/csharp-mode ba36d6c 105/459: Replace `flet` with `letre


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode ba36d6c 105/459: Replace `flet` with `letrec`
Date: Sun, 22 Aug 2021 13:59:06 -0400 (EDT)

branch: externals/csharp-mode
commit ba36d6c771e49a3579d91f9efa684ae57a5731fc
Author: Vasilij Schneidermann <v.schneidermann@gmail.com>
Commit: Vasilij Schneidermann <v.schneidermann@gmail.com>

    Replace `flet` with `letrec`
    
    Closes #39.
---
 csharp-mode.el | 79 ++++++++++++++++++++++++++++++----------------------------
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/csharp-mode.el b/csharp-mode.el
index 0a02034..4a2f9b4 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -2647,16 +2647,18 @@ this fn will be something like this:
      (\"(bottom)\"     . 1))
 
 "
-  (flet ((helper (list new)
-                 (if (null list) new
-                   (let* ((elt (car list))
-                          (topic (csharp--make-plural (csharp--first-word (car 
elt))))
-                          (xelt (assoc topic new)))
-                     (helper (cdr list)
-                             (if xelt
-                                 (progn (incf (cdr xelt)) new)
-                               (cons (cons topic 1) new)))))))
-    (nreverse (helper list nil))))
+  (letrec ((helper
+            (lambda (list new)
+              (if (null list) new
+                (let* ((elt (car list))
+                       (topic (csharp--make-plural
+                               (csharp--first-word(car elt))))
+                       (xelt (assoc topic new)))
+                  (funcall helper (cdr list)
+                           (if xelt
+                               (progn (incf (cdr xelt)) new)
+                             (cons (cons topic 1) new))))))))
+    (nreverse (funcall helper list nil))))
 
 
 
@@ -2914,36 +2916,37 @@ out into multiple submenus.
 
 "
   (let ((counts (csharp--imenu-counts menu-alist)))
-    (flet ((helper
-            (list new)
-            (if (null list)
-                new
-              (let* ((elt (car list))
-                     (topic (csharp--make-plural (csharp--first-word (car 
elt))))
-                     (xelt (assoc topic new)))
-                (helper
-                 (cdr list)
-                 (if xelt
-                     (progn
-                       (rplacd xelt (cons elt (cdr xelt)))
-                       new)
-                   (cons
-
-                    (cond
-                     ((> (cdr (assoc topic counts))
-                         csharp-imenu-max-similar-items-before-extraction)
-                      (cons topic (list elt)))
-
-                     ((imenu--subalist-p elt)
-                      (cons (car elt)
-                            (csharp--imenu-reorg-alist-intelligently (cdr 
elt))))
-                     (t
-                      elt))
-
-                    new)))))))
+    (letrec ((helper
+              (lambda (list new)
+                (if (null list)
+                    new
+                  (let* ((elt (car list))
+                         (topic (csharp--make-plural
+                                 (csharp--first-word (car elt))))
+                         (xelt (assoc topic new)))
+                    (funcall
+                     helper (cdr list)
+                     (if xelt
+                         (progn
+                           (rplacd xelt (cons elt (cdr xelt)))
+                           new)
+                       (cons
+
+                        (cond
+                         ((> (cdr (assoc topic counts))
+                             csharp-imenu-max-similar-items-before-extraction)
+                          (cons topic (list elt)))
+
+                         ((imenu--subalist-p elt)
+                          (cons (car elt)
+                                (csharp--imenu-reorg-alist-intelligently (cdr 
elt))))
+                         (t
+                          elt))
+
+                        new))))))))
 
       (csharp--imenu-break-into-submenus
-       (nreverse (helper menu-alist nil))))))
+       (nreverse (funcall helper menu-alist nil))))))
 
 
 



reply via email to

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