aboutsummaryrefslogtreecommitdiff
path: root/module/output/text.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-24 19:40:46 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-24 19:40:53 +0200
commit0f968fcc28bbb48ad0d65938b05bed3d75c7819c (patch)
tree36f9488a7c444d5e2f3fee30fcef11e1e0deddd3 /module/output/text.scm
parentAdd overriding define-syntax. (diff)
downloadcalp-0f968fcc28bbb48ad0d65938b05bed3d75c7819c.tar.gz
calp-0f968fcc28bbb48ad0d65938b05bed3d75c7819c.tar.xz
Add {mod,set}/r!
`set!' by default has an unspecified return value. But that haven't stopped me from using that (set! (acc obj) val) returns the value returned by the internal setter function. This change requires you to explicitly request the returning version of set, which returns the value of the last set field.
Diffstat (limited to 'module/output/text.scm')
-rw-r--r--module/output/text.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/output/text.scm b/module/output/text.scm
index 7c99e12f..274c79e2 100644
--- a/module/output/text.scm
+++ b/module/output/text.scm
@@ -23,7 +23,7 @@
(string-concatenate/shared
(merge words (map (lambda (n) (make-string n #\space))
space-list)
- (let ((f #t)) (lambda _ (mod! f not)))))))
+ (let ((f #t)) (lambda _ (mod/r! f not)))))))
;; Splits and justifies the given line to @var{#:width}.
@@ -34,7 +34,7 @@
(let* ((head tail (take-drop-while
(let ((w 0))
(lambda (word) ; Take words until we are above the limit.
- (< (mod! w = (+ 1 (string-length word)))
+ (< (mod/r! w = (+ 1 (string-length word)))
width)))
lst)))
(cond ((null? tail) (list (unwords head))) ; Don't justify last line.