Refactor ALL-TAGS to use mappend.

This commit is contained in:
Brit Butler 2012-09-12 15:23:19 -04:00
parent 971b1aa151
commit 597080c161
2 changed files with 4 additions and 4 deletions

View file

@ -21,9 +21,8 @@
(defun all-tags ()
"Retrieve a list of all tags used in posts."
(sort (reduce (lambda (x y) (union x y :test #'string=))
(mapcar #'post-tags (hash-table-values *posts*)))
#'string<))
(sort (remove-duplicates (mappend 'post-tags (hash-table-values *posts*))
:test #'string=) #'string<))
(defun get-month (timestamp)
"Extract the YYYY-MM portion of TIMESTAMP."

View file

@ -2,7 +2,8 @@
(:documentation "Homepage: <a href=\"http://github.com/redline6561/coleslaw\">Github</a>")
(:use :cl)
(:import-from :alexandria #:hash-table-values
#:make-keyword)
#:make-keyword
#:mappend)
(:import-from :closure-template #:compile-template)
(:export #:main
#:add-injection