aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-18 12:37:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-18 12:37:13 +0200
commit493b97c0562ceb66b018eb3d0b92333194b57787 (patch)
tree4b446b1eda25e096965b196989ddc7f43d45b03c
parentAdd tests for (text flow). (diff)
downloadcalp-493b97c0562ceb66b018eb3d0b92333194b57787.tar.gz
calp-493b97c0562ceb66b018eb3d0b92333194b57787.tar.xz
Change add-enumeration-punctuation to always return lists.
-rw-r--r--module/text/util.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/text/util.scm b/module/text/util.scm
index 5ade7144..95f576fe 100644
--- a/module/text/util.scm
+++ b/module/text/util.scm
@@ -44,12 +44,13 @@
trimmed)))
;; TODO more options for infix strings
+;; TODO why does this procedure return lists?
(define* (add-enumeration-punctuation
- list optional: (final-delim "&"))
- (cond [(null? list) ""]
- [(= 1 (length list)) (car list)]
+ lst optional: (final-delim "&"))
+ (cond [(null? lst) '("")]
+ [(= 1 (length lst)) (list (car lst))]
[else
- (let* ((rev (reverse list))
+ (let* ((rev (reverse lst))
(tail (car rev))
(rest (cdr rev)))
(reverse (cons* tail " " final-delim " "