diff options
author | Ben Sima <ben@bsima.me> | 2019-11-02 15:33:13 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-11-02 15:33:13 -0700 |
commit | 9d114cfc773171b0a95bd4d2c39f1bb0eb783c8d (patch) | |
tree | 20766a760ed0141cf39153565e8552f6739c632d /com/simatime/string.scm | |
parent | d2a37f5de160160eadbacd7b8dc2567f78a0543d (diff) |
rename everything back to caps to appease ghc
Diffstat (limited to 'com/simatime/string.scm')
-rw-r--r-- | com/simatime/string.scm | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/com/simatime/string.scm b/com/simatime/string.scm deleted file mode 100644 index 01c5a70..0000000 --- a/com/simatime/string.scm +++ /dev/null @@ -1,24 +0,0 @@ -(define-module (com simatime string) - #:export (replace to-string str capitalize)) - -(define (replace s match repl) - (let ((f (lambda (a b) - (let ((next-char (if (eq? a match) repl a))) - (string-concatenate (list b (string next-char))))))) - (string-fold f "" s))) - -(define (to-string x) - (format #f "~a" x)) - -(define str - (case-lambda - (() "") - ((x) (to-string x)) - ((x . rest) (string-concatenate (map str (cons x rest)))))) - -(define (capitalize s) - (let ((s (to-string s))) - (if (< (string-length s) 2) - (string-upcase s) - (str (string-upcase (substring s 0 1)) - (substring s 1 ))))) |