diff options
Diffstat (limited to 'module/text')
-rw-r--r-- | module/text/flow.scm | 13 | ||||
-rw-r--r-- | module/text/numbers.scm | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/module/text/flow.scm b/module/text/flow.scm index 315bea06..77f39a9f 100644 --- a/module/text/flow.scm +++ b/module/text/flow.scm @@ -8,21 +8,22 @@ :use-module (text util) :use-module (srfi srfi-1) :use-module (srfi srfi-71) + :use-module (srfi srfi-88) :export (flow-text)) ;; str -> (str) -(define* (flow-text str #:key (width 70)) +(define* (flow-text str key: (width 70)) (flatten - (map (lambda (line) (justify-line line #:width width)) + (map (lambda (line) (justify-line line width: width)) (lines str)))) -;; Splits and justifies the given line to @var{#:width}. +;; Splits and justifies the given line to @var{width:}. ;; Returns a list of justified strings. ;; str -> (str) -(define* (justify-line line #:key (width 70)) +(define* (justify-line line key: (width 70)) (let recur ((lst (words line))) (let ((head tail (span (let ((w 0)) @@ -36,11 +37,11 @@ ;; than our max width. Add it as is and continue ;; (while crying). (cons (car tail) (recur (cdr tail)))) - (else (cons (justify-line-helper head #:width width) + (else (cons (justify-line-helper head width: width) (recur tail))))))) ;; (str) -> str -(define* (justify-line-helper words #:key (width 70)) +(define* (justify-line-helper words key: (width 70)) (let* ((phrase-length (true-string-length (string-concatenate/shared words))) (needed-spaces (- width phrase-length)) (slots (1- (length words))) diff --git a/module/text/numbers.scm b/module/text/numbers.scm index 168d267e..c45016bc 100644 --- a/module/text/numbers.scm +++ b/module/text/numbers.scm @@ -1,4 +1,5 @@ (define-module (text numbers) + :use-module (srfi srfi-88) :export (number->string-cardinal number->string-ordinal each-string)) @@ -17,11 +18,11 @@ 2))) (define* (number->string-cardinal - n #:optional (language (resolve-language))) + n optional: (language (resolve-language))) ((get language 'number->string-cardinal) n)) (define* (number->string-ordinal - n #:optional (language (resolve-language))) + n optional: (language (resolve-language))) ((get language 'number->string-ordinal) n)) ;; TODO change API to allow language, and stop having random extra |