From cc64fa01e9bae297915906a03f85fe50be384990 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 23 Nov 2019 15:59:08 -0800 Subject: Capitalize all Scheme and Haskell modules --- Com/Simatime/string.scm | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Com/Simatime/string.scm (limited to 'Com/Simatime/string.scm') diff --git a/Com/Simatime/string.scm b/Com/Simatime/string.scm deleted file mode 100644 index 3d32cd1..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 ))))) -- cgit v1.2.3