[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo b484515 064/357: [gnugo int] Use ‘loop’, functio
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo b484515 064/357: [gnugo int] Use ‘loop’, functional style more. |
Date: |
Sun, 29 Nov 2020 14:50:49 -0500 (EST) |
branch: externals/gnugo
commit b4845156eb14706336abe23182edd4c9eb24cb7b
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Use ‘loop’, functional style more.
* packages/gnugo/gnugo.el (gnugo-describe-internal-properties):
...here, for collecting/massaging ‘gnugo-state’,
instead of ‘maphash’, "manual" destructuring, mutation.
---
gnugo.el | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 0a4b345..917579c 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -247,24 +247,22 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(interactive)
(let ((buf (current-buffer))
(d (gnugo-get :diamond))
- acc)
- (maphash (lambda (&rest args)
- (case (car args)
- ((:xpms :local-xpms)
- (setcdr args (format "hash: %X (%d images)"
- (sxhash (cadr args))
- (length (cadr args)))))
- (:sgf-collection
- (setcdr args (length (cadr args))))
- (:monkey
- (let* ((value (cadr args))
- (loc (aref value 0)))
- (setcdr args (list
- (length (aref value 1))
- (length (cdr loc))
- (car loc))))))
- (setq acc (cons args acc)))
- gnugo-state)
+ (acc (loop for key being the hash-keys of gnugo-state
+ using (hash-values val)
+ collect (cons key
+ (case key
+ ((:xpms :local-xpms)
+ (format "hash: %X (%d images)"
+ (sxhash val)
+ (length val)))
+ (:sgf-collection
+ (length val))
+ (:monkey
+ (let ((loc (aref val 0)))
+ (list (length (aref val 1))
+ (length (cdr loc))
+ (car loc))))
+ (t val))))))
(switch-to-buffer (get-buffer-create
(format "%s*GNUGO Board Properties*"
(gnugo-get :diamond))))
- [elpa] externals/gnugo a3d90aa 189/357: [gnugo maint] Update HACKING; nfc., (continued)
- [elpa] externals/gnugo a3d90aa 189/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5dcf9f6 185/357: [gnugo int] Add abstraction: gnugo--node-with-played-stone, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1367651 173/357: [gnugo int] Make ‘gnugo-gate’ slightly faster., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a4c246e 188/357: [gnugo frolic] Display "!" for comment; add as ‘help-echo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8203f46 194/357: [gnugo int] Centralize some constant strings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b1f2856 183/357: [gnugo] Fix bug: Keep subproc informed of forced PASS., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3112192 056/357: [gnugo int] Streamline subproc (de-)marshalling., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 294bdc1 047/357: [gnugo maint] Update NEWS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5f47cb 059/357: [gnugo int] Use ‘pcase’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8cabdfa 042/357: [gnugo int] Use internal macros more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b484515 064/357: [gnugo int] Use ‘loop’, functional style more.,
Stefan Monnier <=
- [elpa] externals/gnugo a7dffa0 067/357: [gnugo maint] Update NEWS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d2b4549 068/357: [gnugo] Bind ‘M-u’ to ‘gnugo-undo-one-move’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f82c526 078/357: [gnugo int] Use ‘following-char’ instead of ‘char-after’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f29b22f 081/357: [gnugo int] Use ‘setq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 38137d3 079/357: [gnugo int] Cache gametree prop ‘:SZ’ as gnugo prop ‘:SZ’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d6f3956 089/357: [gnugo int] Decruft: Infer MOVEP from PROPERTY., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5ca5b0a 097/357: [gnugo int] Add abstraction: gnugo--nodep, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a86a897 013/357: [gnugo int] Use ‘redisplay’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3063f95 041/357: [gnugo] Make proc-status change mode-line elem more informative., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c2f7717 053/357: [gnugo slog] Fix bug: Avoid ‘cl-lib’ funcs; use only macros., Stefan Monnier, 2020/11/29