diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-18 12:37:13 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-18 12:37:13 +0200 |
commit | 493b97c0562ceb66b018eb3d0b92333194b57787 (patch) | |
tree | 4b446b1eda25e096965b196989ddc7f43d45b03c /module/text | |
parent | Add tests for (text flow). (diff) | |
download | calp-493b97c0562ceb66b018eb3d0b92333194b57787.tar.gz calp-493b97c0562ceb66b018eb3d0b92333194b57787.tar.xz |
Change add-enumeration-punctuation to always return lists.
Diffstat (limited to '')
-rw-r--r-- | module/text/util.scm | 9 |
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 " " |