aboutsummaryrefslogtreecommitdiff
path: root/module/text
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 04:14:46 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 04:14:46 +0200
commit2fb88465f7a25b1eac0cdbb78a05de9e78e68bfd (patch)
treec48c312e1d44306039fc00cfe4b5cd611d7f9a3b /module/text
parentRemove procedure tabset. (diff)
downloadcalp-2fb88465f7a25b1eac0cdbb78a05de9e78e68bfd.tar.gz
calp-2fb88465f7a25b1eac0cdbb78a05de9e78e68bfd.tar.xz
Normalize keyword syntax.
Diffstat (limited to 'module/text')
-rw-r--r--module/text/flow.scm13
-rw-r--r--module/text/numbers.scm5
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