;; Usage: (split s) ;; ;; Returns: String s split into words, in lowercase without non-alphabetic ;; characters. ;; ;; Example: ;; (split "This is a string!!") ;; Returns: ;; ("this" "is" "a" "string") (defun rsplit (list &optional (splitted ()) (cur ())) (if (null list) (if cur (cons cur splitted) splitted) (let ((ch (car list))) (if (alpha-char-p ch) (rsplit (cdr list) splitted (cons ch cur)) (if cur (rsplit (cdr list) (cons cur splitted)) (rsplit (cdr list) splitted)))))) (defun split (s) (mapcar #'(lambda (x) (map 'string #'char-downcase x)) (rsplit (nreverse (coerce s 'list)))))