Sha256: 9391dc8dd4ab1308f9d26144cdfe126ae9064e169aae433bb0d7b1e1f4171710

Contents?: true

Size: 574 Bytes

Versions: 127

Compression:

Stored size: 574 Bytes

Contents

(in-package #:cl-user)
(defpackage #:acronym
  (:use #:cl)
  (:export #:acronym))

(in-package #:acronym)

(defun acronym (str)
  (labels ((recur (st ls)
    (cond
      ((equal "" st)
        ls)
      ((both-case-p (elt st 0))
       (recur (string-left-trim
              "abcdefghijklmnopqrstuvwxyz"
              (string-left-trim
                "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                st))
             (cons (elt st 0)
                   ls)))
      (t (recur (subseq st 1) ls)))))
    (map 'string
         #'char-upcase
         (nreverse (recur str nil)))))

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
trackler-2.2.1.58 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.57 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.56 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.55 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.54 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.53 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.52 tracks/common-lisp/exercises/acronym/example.lisp