[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
164/197: gurses: Use match instead of car.
From: |
Danny Milosavljevic |
Subject: |
164/197: gurses: Use match instead of car. |
Date: |
Mon, 3 Jul 2017 20:37:18 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 7befec24b641ca9fdec675f08bca566f506ace6e
Author: John Darrington <address@hidden>
Date: Wed Feb 1 17:40:40 2017 +0100
gurses: Use match instead of car.
* gurses/buttons.scm (buttons-fetch-by-key): Remove car/cdr and use match.
---
gurses/buttons.scm | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/gurses/buttons.scm b/gurses/buttons.scm
index a91b01f..76b637a 100644
--- a/gurses/buttons.scm
+++ b/gurses/buttons.scm
@@ -27,7 +27,6 @@
#:export (buttons-selected)
#:export (buttons-fetch-by-key)
#:export (buttons-n-buttons)
- #:export (buttons-get-current-selection)
#:export (buttons-key-matches-symbol?)
#:use-module (ncurses curses)
@@ -75,10 +74,10 @@
(key #f))
(if (or key (not (array-in-bounds? (buttons-array buttons) idx)))
key
- (let* ((k (array-ref (buttons-array buttons) idx))
- (kk (list-ref k 2)))
- (loop (1+ idx) (if (eq? (car k) c) kk #f))))))
-
+ (loop (1+ idx)
+ (match (array-ref (buttons-array buttons) idx)
+ ((ch win sym)
+ (if (eq? ch c) sym #f)))))))
(define (buttons-select buttons which)
(let ((arry (buttons-array buttons))
- 123/197: installer: Add a popup window for forms which have multiple choice fields., (continued)
- 123/197: installer: Add a popup window for forms which have multiple choice fields., Danny Milosavljevic, 2017/07/03
- 121/197: installer: Note which types of file system are supported., Danny Milosavljevic, 2017/07/03
- 141/197: gurses: Avoid one usage of car and cdr., Danny Milosavljevic, 2017/07/03
- 151/197: installer: Avoid wpa_supplicant's output causing screen damage., Danny Milosavljevic, 2017/07/03
- 99/197: installer: Exit the format page after all partitions are successfully formatted., Danny Milosavljevic, 2017/07/03
- 101/197: installer: Replace one usage of car with match., Danny Milosavljevic, 2017/07/03
- 109/197: installer: Fix bug where the selected item of main page was not indicated., Danny Milosavljevic, 2017/07/03
- 104/197: installer: Support btrfs, Danny Milosavljevic, 2017/07/03
- 111/197: gurses: Change highlighting from bold to inverse., Danny Milosavljevic, 2017/07/03
- 108/197: installer: Do not add file systems which are invalid., Danny Milosavljevic, 2017/07/03
- 164/197: gurses: Use match instead of car.,
Danny Milosavljevic <=
- 170/197: installer: Remove unused procedure., Danny Milosavljevic, 2017/07/03
- 152/197: installer: New file i18n.scm., Danny Milosavljevic, 2017/07/03
- 110/197: installer: Add an explanatory text to the main page., Danny Milosavljevic, 2017/07/03
- 120/197: gurses: Mini refactor., Danny Milosavljevic, 2017/07/03
- 124/197: gurses: Populate dropdown boxes in forms using a menu., Danny Milosavljevic, 2017/07/03
- 131/197: gurses: Use inverse instead of underline for field value area., Danny Milosavljevic, 2017/07/03
- 133/197: installer: Change livery., Danny Milosavljevic, 2017/07/03
- 146/197: gurses: Use match instead of car/cdr in line-split., Danny Milosavljevic, 2017/07/03
- 147/197: gurses: In paragraph-format avoid use of car and cdr., Danny Milosavljevic, 2017/07/03
- 144/197: gurses: Avoid one more use of car and cdr., Danny Milosavljevic, 2017/07/03