diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-28 00:59:14 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-28 00:59:14 +0200 |
commit | a418a180b9eb1c542ab3fc1f3651ce6244965862 (patch) | |
tree | e133bcc50a170a97c82a57d7a411dac22faa621e /module/text/util.scm | |
parent | Remove unused (sxml html). (diff) | |
download | calp-a418a180b9eb1c542ab3fc1f3651ce6244965862.tar.gz calp-a418a180b9eb1c542ab3fc1f3651ce6244965862.tar.xz |
Some clarifications in text submodules.
Diffstat (limited to '')
-rw-r--r-- | module/text/util.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/module/text/util.scm b/module/text/util.scm index b2560bf4..b87e29f2 100644 --- a/module/text/util.scm +++ b/module/text/util.scm @@ -1,5 +1,10 @@ +;;; Commentary: +;;; Small utility functions which helps the rest of the text processing. +;;; Code: + (define-module (text util) - :use-module (calp util)) + :use-module ((calp util) :select (define*-public intersperce) ) + ) (define-public (words str) (string-split str #\space)) (define-public (unwords list) (string-join list " " 'infix)) @@ -40,6 +45,8 @@ (cond [(null? list) ""] [(= 1 (length list)) (car list)] [else - (let* (((tail . rest) (reverse list))) + (let* ((rev (reverse list)) + (tail (car rev)) + (rest (cdr rev))) (reverse (cons* tail " " final-delim " " (intersperce ", " rest))))])) |