diff options
Diffstat (limited to 'exercism/emacs-lisp/acronym/acronym.el')
-rw-r--r-- | exercism/emacs-lisp/acronym/acronym.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/exercism/emacs-lisp/acronym/acronym.el b/exercism/emacs-lisp/acronym/acronym.el new file mode 100644 index 0000000..8c6a628 --- /dev/null +++ b/exercism/emacs-lisp/acronym/acronym.el @@ -0,0 +1,16 @@ +;;; acronym.el --- Acronym (exercism) + +;;; Commentary: + +;;; Code: + +(require 'cl-lib) + +(defun kj/abbrev-word (w) + (upcase (substring w 0 1))) + +(defun acronym (str) + (mapconcat 'kj/abbrev-word (split-string str "\\W+" t) "")) + +(provide 'acronym) +;;; acronym.el ends here |