[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
147/197: gurses: In paragraph-format avoid use of car and cdr.
From: |
Danny Milosavljevic |
Subject: |
147/197: gurses: In paragraph-format avoid use of car and cdr. |
Date: |
Mon, 3 Jul 2017 20:37:16 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 24c0ee3c006a603797ce32a8411f7fd6e4ff73bc
Author: John Darrington <address@hidden>
Date: Fri Jan 27 09:21:30 2017 +0100
gurses: In paragraph-format avoid use of car and cdr.
* gurses/stexi.scm (paragraph-format): Use match instead of car and cdr.
---
gurses/stexi.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gurses/stexi.scm b/gurses/stexi.scm
index c054676..e85ed82 100644
--- a/gurses/stexi.scm
+++ b/gurses/stexi.scm
@@ -149,9 +149,10 @@ cdr is the remainder"
(define (paragraph-format cs line-length)
(let loop ((pr (line-split cs line-length))
(acc '()))
- (if (null? (cdr pr))
- (cons (car pr) acc)
- (loop (line-split (cdr pr) line-length) (cons (car pr) acc)))))
+ (match pr
+ ((only) (cons only acc))
+ ((first . rest)
+ (loop (line-split rest line-length) (cons first acc))))))
(define (justify text line-length)
(reverse (paragraph-format text line-length )))
- 108/197: installer: Do not add file systems which are invalid., (continued)
- 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, 2017/07/03
- 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 <=
- 144/197: gurses: Avoid one more use of car and cdr., Danny Milosavljevic, 2017/07/03
- 143/197: gurses: Add predicate to test if a complex char is blank., Danny Milosavljevic, 2017/07/03
- 149/197: gurses: Add new procedure "word-endings"., Danny Milosavljevic, 2017/07/03
- 155/197: installer: Use _ instead of M_ for host-name-refresh., Danny Milosavljevic, 2017/07/03
- 160/197: installer: New convenience procedures., Danny Milosavljevic, 2017/07/03
- 158/197: installer: Correct placement of gettext call., Danny Milosavljevic, 2017/07/03
- 163/197: gurses: Cache the windows of buttons., Danny Milosavljevic, 2017/07/03
- 172/197: gurses: Update the cursor position when posting the form., Danny Milosavljevic, 2017/07/03
- 165/197: installer: New procedure key-value-slurp., Danny Milosavljevic, 2017/07/03
- 175/197: gurses: Don't crash if asked for an item by an invalid index., Danny Milosavljevic, 2017/07/03