aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2008-12-12 21:18:09 +0000
committerStuart Sierra <mail@stuartsierra.com>2008-12-12 21:18:09 +0000
commitbaef7d3c8806f162a8addde65bb50369ea5527dd (patch)
tree674c42ae37c8afc5d1ce1ac205e68f2cf98bb2f1 /src/clojure/contrib
parent3c38380d4f48dc4ca51d8863b38bc128fbdcd1b4 (diff)
seq_utils.clj: fixed misplaced doc strings (report by Perry Trolard)
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r--src/clojure/contrib/seq_utils.clj6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/clojure/contrib/seq_utils.clj b/src/clojure/contrib/seq_utils.clj
index c5e0036f..38d25e2a 100644
--- a/src/clojure/contrib/seq_utils.clj
+++ b/src/clojure/contrib/seq_utils.clj
@@ -46,10 +46,11 @@
;; group-by written by Rich Hickey;
;; see http://paste.lisp.org/display/64190
-(defn group-by [f coll]
+(defn group-by
"Returns a sorted map of the elements of coll keyed by the result of
f on each element. The value at each key will be a vector of the
corresponding elements, in the order they appeared in coll."
+ [f coll]
(reduce
(fn [ret x]
(let [k (f x)]
@@ -58,9 +59,10 @@
;; partition-by written by Rich Hickey;
;; see http://paste.lisp.org/display/64190
-(defn partition-by [f coll]
+(defn partition-by
"Applies f to each value in coll, splitting it each time f returns
a new value. Returns a lazy seq of lazy seqs."
+ [f coll]
(when-let [s (seq coll)]
(let [fv (f (first s))
ends (drop-while #(= fv (f %)) (rest s))