aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-24 19:47:33 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-24 19:47:33 +0200
commit9c36db09b9a19cd70dfcc1ccce58f137df296d95 (patch)
treef4a805aa5ac2c3f8de18d8e9ec53ed6808b3233c
parentRewrote quick-case macro. Keeps signature. (diff)
downloadcalp-9c36db09b9a19cd70dfcc1ccce58f137df296d95.tar.gz
calp-9c36db09b9a19cd70dfcc1ccce58f137df296d95.tar.xz
Remove take-drop-while, span already in SRFI-1.
-rw-r--r--module/output/text.scm2
-rw-r--r--module/util.scm10
2 files changed, 1 insertions, 11 deletions
diff --git a/module/output/text.scm b/module/output/text.scm
index 274c79e2..5d8248f4 100644
--- a/module/output/text.scm
+++ b/module/output/text.scm
@@ -31,7 +31,7 @@
;; str -> (str)
(define* (justify-line line #:key (width 70))
(let recur ((lst (words line)))
- (let* ((head tail (take-drop-while
+ (let* ((head tail (span
(let ((w 0))
(lambda (word) ; Take words until we are above the limit.
(< (mod/r! w = (+ 1 (string-length word)))
diff --git a/module/util.scm b/module/util.scm
index 9673288d..d1bdfca1 100644
--- a/module/util.scm
+++ b/module/util.scm
@@ -327,16 +327,6 @@
(append done ((if (list? subl) flatten list) subl)))
'() lst))
-;; Retuns two values. The longset head which satisfies @var{pred?},
-;; and the rest of the elements of list.
-;; Guarentees to only call @var{pred?} once for each element.
-(define-public (take-drop-while pred? list)
- (let loop ((done '()) (rem list))
- (cond ((null? rem) (values (reverse done) '()))
- ((pred? (car rem)) (loop (cons (car rem) done) (cdr rem)))
- (else (values (reverse done) rem)))))
-
-
(define* (tree-map proc tree #:key (descend (const #t)))
(cond ((not (list? tree)) (proc tree))
((null? tree) '())