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

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

[elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead


From: Stefan Monnier
Subject: [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’.
Date: Sun, 29 Nov 2020 14:50:56 -0500 (EST)

branch: externals/gnugo
commit 35b15514186ab0938ee53047dcd3b5571fa93767
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’.
    
    * packages/gnugo/gnugo.el (gnugo-board-mode): ...here.
---
 gnugo.el | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 2d68780..4448877 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1777,22 +1777,22 @@ In this mode, keys do not self insert.
       (gnugo-put :sgf-collection (list tree))
       (gnugo-put :monkey (vector tree nil 0)))
     (gnugo--SZ! board-size)
-    (let ((g-blackp (string= "white" user-color)))
-      (mapc (lambda (x) (apply 'gnugo-note x))
-            `((:SZ ,board-size)
-              (:DT ,(format-time-string "%Y-%m-%d"))
-              (:RU ,(if (string-match "--chinese-rules" args)
-                        "Chinese"
-                      "Japanese"))
-              (:AP ("gnugo.el" . ,gnugo-version))
-              (:KM ,komi)
-              (,(if g-blackp :PW :PB) ,(user-full-name))
-              (,(if g-blackp :PB :PW) ,(concat "GNU Go "
-                                               (gnugo-query "version")))
-              ,@(when (not (zerop handicap))
-                  `((:HA ,handicap)
-                    (:AB ,(gnugo-lsquery "fixed_handicap %d" handicap)
-                         nil t)))))))
+    (loop with gb = (gnugo--blackp (gnugo-other user-color))
+          for (property value &optional mogrifyp) in
+          `((:SZ ,board-size)
+            (:DT ,(format-time-string "%Y-%m-%d"))
+            (:RU ,(if (string-match "--chinese-rules" args)
+                      "Chinese"
+                    "Japanese"))
+            (:AP ("gnugo.el" . ,gnugo-version))
+            (:KM ,komi)
+            (,(if gb :PW :PB) ,(user-full-name))
+            (,(if gb :PB :PW) ,(concat "GNU Go " (gnugo-query "version")))
+            ,@(when (not (zerop handicap))
+                `((:HA ,handicap)
+                  (:AB ,(gnugo-lsquery "fixed_handicap %d" handicap)
+                       t))))
+          do (gnugo-note property value mogrifyp)))
   (gnugo-put :waiting-start (current-time))
   (gnugo-put :hmul 1)
   (gnugo-put :wmul 1)



reply via email to

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