aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/seq_utils.clj
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2009-08-25 21:52:48 -0400
committerStuart Halloway <stu@thinkrelevance.com>2009-08-25 21:52:48 -0400
commitc3cc2ea4356abc6c9e3faf43c862e3d6df3f28de (patch)
tree4517577a06fefe89b2a343198b8e93cde3be48d3 /src/clojure/contrib/seq_utils.clj
parentaddc9c1460d56074962d85a99685573319a3c496 (diff)
parentf191c6be636ad682343279280fbe02fb2a956a03 (diff)
Merge branch 'expect'
Diffstat (limited to 'src/clojure/contrib/seq_utils.clj')
-rw-r--r--src/clojure/contrib/seq_utils.clj10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/clojure/contrib/seq_utils.clj b/src/clojure/contrib/seq_utils.clj
index d4c29c46..ad913f70 100644
--- a/src/clojure/contrib/seq_utils.clj
+++ b/src/clojure/contrib/seq_utils.clj
@@ -211,3 +211,13 @@
(cons (if (identical? x NIL) nil x)
(drain))))))))))
+(defn positions
+ "Returns a lazy sequence containing the positions at which pred
+ is true for items in coll."
+ [pred coll]
+ (for [[idx elt] (indexed coll) :when (pred elt)] idx))
+
+
+
+
+