diff options
Diffstat (limited to 'strcase.scm')
-rw-r--r-- | strcase.scm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/strcase.scm b/strcase.scm index b46b223..30b58ad 100644 --- a/strcase.scm +++ b/strcase.scm @@ -4,6 +4,7 @@ ; This code is in the public domain. ; Modified by Aubrey Jaffer Nov 1992. +; SYMBOL-APPEND added by A. Jaffer 2001. ; Authors of the original version were Ken Dickey and Aubrey Jaffer. ;string-upcase, string-downcase, string-capitalize @@ -45,6 +46,21 @@ (string-capitalize! (string-copy str))) (define string-ci->symbol - (if (equal? "a" (symbol->string 'a)) - (lambda (str) (string->symbol (string-downcase str))) - (lambda (str) (string->symbol (string-upcase str))))) + (let ((s2cis (if (equal? "x" (symbol->string 'x)) + string-downcase string-upcase))) + (lambda (str) (string->symbol (s2cis str))))) + +(define symbol-append + (let ((s2cis (if (equal? "x" (symbol->string 'x)) + string-downcase string-upcase))) + (lambda args + (string->symbol + (apply string-append + (map + (lambda (obj) + (cond ((string? obj) (s2cis obj)) + ((number? obj) (s2cis (number->string obj))) + ((symbol? obj) (symbol->string obj)) + ((not obj) "") + (else (slib:error 'wrong-type-to 'symbol-append obj)))) + args)))))) |