Permalink
Browse files

Added a better sequence formatter.

  • Loading branch information...
1 parent 519fd0a commit 939496faa3657c32253a8b09b70c9dc483622085 @Raynes committed Sep 22, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/cake_github/core.clj
View
@@ -59,7 +59,10 @@
(defn format-generic-map [m]
(format-keys (line-template (max-width m)) m))
-;; This will likely become a multimethod.
+(defn format-sequence [s]
+ (apply str (apply concat (interpose ["\n"] (partition-all 10 (interpose ", " s))))))
+
+;; This might become a multimethod.
(defn format-result-helper [result map-type]
(str "\n"
(cond
@@ -71,7 +74,7 @@
(string? result) result
(nil? result) "wut"
(not (seq result)) "Nothing interested happened.\n"
- :else (str (apply str (interpose ", " result)) "\n"))))
+ :else (str (format-sequence result) "\n"))))
(defn option-to-int [opt default]
(cond

0 comments on commit 939496f

Please sign in to comment.