Created
July 7, 2014 08:30
-
-
Save rockBreaker/a8ee92b0aed48ce2c092 to your computer and use it in GitHub Desktop.
final books-string using interpose cos its better than my brain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn books->string | |
[books] | |
(cond (= (count books) 0) "No books." | |
(= (count books) 1) (str "1 book. " (apply book->string books) ".") | |
:else (str (count books) " books. " (apply str (interpose ". " (map book->string books))) "."))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment