William James
7/22/2015 8:33:00 PM
Kenny Tilton wrote:
> (defun lisp-fn (n$ &aux ln)
> (dotimes (n (length n$) (intern (coerce (nreverse ln) 'string)))
> (let ((c (elt n$ n)))
> (when (and (upper-case-p c)
> (or (lower-case-p (elt n$ (1- n)))
> (lower-case-p (elt n$ (1+ n)))))
> (push #\- ln))
> (push (char-upcase c) ln))))
>
> > (lisp-fn "sTuDlYcApS")
> S-TU-DL-YC-AP-S
Gauche Scheme:
(use srfi-13 :only (string-downcase string-trim))
(define (de-stud name)
(string->symbol
(string-downcase
(string-trim
(regexp-replace-all #/[A-Z]/ name "-\\0")
#\-))))
(de-stud "XsTuDLYcApS")
===>
xs-tu-d-l-yc-ap-s
--
Swedes are now in many ways treated as second-class citizens in their own
country. The very word "Swede" has been given a negative connotation. This kind
of project has now been introduced all over Western Europe.
fjordman.blogspot.ca/2005/05/is-swedish-democracy-collapsing.html