From 73a4bfc3d8e9bb5365e33a11a6ad3b8340d5195b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Jun 2022 21:09:35 +0200 Subject: Remove custom let*. While it was nice, the most important part was the multi-valued let from srfi-71 (which is implemented in srfi-71)). The minor pattern matching structures could often be replaced with car+cdr, or a propper match. --- module/text/flow.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/text/flow.scm') diff --git a/module/text/flow.scm b/module/text/flow.scm index f7e08e1b..3b958480 100644 --- a/module/text/flow.scm +++ b/module/text/flow.scm @@ -7,6 +7,7 @@ :use-module (hnh util) :use-module (text util) :use-module (srfi srfi-1) + :use-module (srfi srfi-71) ) @@ -23,12 +24,12 @@ ;; str -> (str) (define* (justify-line line #:key (width 70)) (let recur ((lst (words line))) - (let* ((head tail (span - (let ((w 0)) - (lambda (word) ; Take words until we are above the limit. - (< (set/r! w = (+ 1 (true-string-length word))) - width))) - lst))) + (let ((head tail (span + (let ((w 0)) + (lambda (word) ; Take words until we are above the limit. + (< (set/r! w = (+ 1 (true-string-length word))) + width))) + lst))) (cond ((null? tail) (list (unwords head))) ; Don't justify last line. ((null? head) ;; an empty head implies that we found a word longer -- cgit v1.2.3