main
Matthew Butterick 6 years ago
parent c0c0a4c897
commit e547c15e3e

@ -68,17 +68,14 @@
;; (on the idea that breaks should separate things, and there's nothing left to separate)
(dropf-right (append* (reverse xs)) (λ (x) (break-val=? break-val x))))
(define wraps
(for/fold ([wraps null]
[xs xs]
#:result wraps)
([i (in-naturals)]
#:break (null? xs))
(let loop ([wraps null][xs xs])
(match xs
[(? null?) wraps]
[(cons (? hard-break?) rest)
(debug-report x 'hard-break)
(values (cons (list break-val) wraps) rest)]
(loop (cons (list break-val) wraps) rest)]
[_ (define-values (head tail) (splitf-at xs (λ (x) (not (hard-break? x)))))
(values (cons (cleanup-wraplist (break-softs head
(loop (cons (cleanup-wraplist (break-softs head
target-size
debug
break-val

Loading…
Cancel
Save