diff options
Diffstat (limited to 'Lisp/name-conversion.lisp')
-rw-r--r-- | Lisp/name-conversion.lisp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lisp/name-conversion.lisp b/Lisp/name-conversion.lisp index 767edaa..7a7f476 100644 --- a/Lisp/name-conversion.lisp +++ b/Lisp/name-conversion.lisp @@ -22,14 +22,19 @@ (defun message-component->string (symbol) (let* ((components (split-sequence #\- (symbol-name symbol) :remove-empty-subseqs t)) + (downcasep (notany #'lower-case-p (symbol-name symbol))) (acc-string (reduce #'(lambda (x y) (concatenate 'string x y)) (mapcar #'(lambda (x) - (concatenate 'string - (string (char x 0)) - (string-downcase (subseq x 1)))) + (if downcasep + (concatenate 'string + (string (char x 0)) + (string-downcase (subseq x 1))) + x)) (subseq components 1)) - :initial-value (string-downcase (first components))))) + :initial-value (if downcasep + (string-downcase (first components)) + (first components))))) (if (eql (find-package '#:keyword) (symbol-package symbol)) (concatenate 'string acc-string ":") |