diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-11-25 11:14:04 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-11-25 11:14:04 -0500 |
commit | d655a8498c45209478a7933b05ad49f3863a345d (patch) | |
tree | bb90fb66ed5d154d0b980eb915271125ed21457e /exercism/emacs-lisp/acronym/acronym.el | |
parent | c0def58b13c9364e0815f0c931a86ee199b30493 (diff) |
acronym exercise
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 |