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.180 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.179 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.178 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.177 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.176 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.175 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.174 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.173 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.172 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.171 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.170 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.169 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.167 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.166 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.165 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.164 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.163 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.162 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.161 tracks/common-lisp/exercises/acronym/example.lisp
trackler-2.2.1.160 tracks/common-lisp/exercises/acronym/example.lisp